Skip to content

Commit

Permalink
Replace the use of update_forward_refs() with model_rebuild()
Browse files Browse the repository at this point in the history
  • Loading branch information
candleindark committed Dec 1, 2023
1 parent 739db75 commit 50a794c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dandischema/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,10 @@ def ensure_value(cls, val: Union[Any, List[Any]]) -> Union[Any, List[Any]]:
_ldmeta = {"nskey": "schema"}


PropertyValue.update_forward_refs()
# This is mostly not needed at all since self-referencing models
# are automatically resolved by Pydantic in a pretty consistent way even in Pydantic V1
# https://docs.pydantic.dev/1.10/usage/postponed_annotations/#self-referencing-models
PropertyValue.model_rebuild()

Identifier = str
ORCID = str
Expand Down

0 comments on commit 50a794c

Please sign in to comment.