Skip to content

Extras field of records should not be None/NULL#854

Merged
bennybp merged 1 commit into
mainfrom
extras_notnull
Oct 31, 2024
Merged

Extras field of records should not be None/NULL#854
bennybp merged 1 commit into
mainfrom
extras_notnull

Conversation

@bennybp
Copy link
Copy Markdown
Contributor

@bennybp bennybp commented Oct 30, 2024

Description

The extras field of base_record (therefore all records) should probably not be null. It's more consistent that it's a dict, even if it's empty.

The original idea is that extras is only populated on record completion. But

  • At some point, we might make these settable by the submitter
  • We may eventually move to an EAV table, which would always result in an empty dict anyway

This inconsistency has caused problems for some users as well: openforcefield/openff-bespokefit#369 openforcefield/openff-bespokefit#370

Relatively easy fix - make the db column not null, and the pydantic field not optional. A small validator is added to halp newer clients use older servers.

This is backwards compatible - new clients can use old servers, and old clients can still use new servers.

Status

  • Code base linted
  • Ready to go

@bennybp bennybp merged commit 4ebcd88 into main Oct 31, 2024
@bennybp bennybp deleted the extras_notnull branch October 31, 2024 14:55
@j-wags
Copy link
Copy Markdown

j-wags commented Oct 31, 2024

Awesome, thanks Ben!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants