-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add support for Pydantic 2 #440
Conversation
@@ -161,7 +161,7 @@ class InnerSchema(BaseModel): | |||
class MediumSchema(BaseModel): | |||
s: str | |||
nested: InnerSchema | |||
nested_opt: Optional[InnerSchema] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I had to change this in the test suite. For some reason, leaving it as Optional[InnerSchema]
caused ref.nested.nested_opt.m.uuid
not to be raised. Must be a change in how Pydantic 2 handles optional-annotated fields.
@utf: This should be ready to review + merge! |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #440 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 19 19
Lines 1509 1510 +1
Branches 412 414 +2
=========================================
+ Hits 1509 1510 +1
|
Thanks @Andrew-S-Rosen, looks great. |
@utf: As you likely saw, Pydantic 2 introduced many new features and changes. In an effort to support Pydantic 2, much of the MP software stack has now been modified accordingly. With maggma, emmet, and monty now supporting Pydantic 2, I have updated Jobflow to match.
Tagging @munrojm who initiated this switch for the rest of the MP stack. I haven't gotten all the tests to pass yet --- suggestions are very welcome!
Closes #422.