Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Conversation

bennybp
Copy link
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
18 of 19 checks passed
@bennybp bennybp deleted the extras_notnull branch October 31, 2024 14:55
@j-wags
Copy link

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