Skip to content

Commit

Permalink
refactor: replace deprecated BaseModel.parse_obj with `BaseModel.mo…
Browse files Browse the repository at this point in the history
…del_validate`
  • Loading branch information
ketozhang committed Nov 20, 2024
1 parent 1e74b8a commit c7f6289
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion asdf_pydantic/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ def to_yaml_tree(self, obj: AsdfPydanticModel, tag, ctx):
return obj.asdf_yaml_tree()

def from_yaml_tree(self, node, tag, ctx):
return self._tag_to_class[tag].parse_obj(node)
return self._tag_to_class[tag].model_validate(node)
2 changes: 1 addition & 1 deletion asdf_pydantic/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class AsdfPydanticModel(BaseModel):
ASDF Serialization and Deserialization:
Serialize to ASDF yaml tree is done with the
py:classmethod`AsdfPydanticModel.asdf_yaml_tree()` and deserialize to an
AsdfPydanticModel object with py:meth`AsdfPydanticModel.parse_obj()`.
AsdfPydanticModel object with py:meth`AsdfPydanticModel.model_validate()`.
"""

_tag: ClassVar[str | TagDefinition]
Expand Down

0 comments on commit c7f6289

Please sign in to comment.