-
Notifications
You must be signed in to change notification settings - Fork 0
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
Pydantic v2 upgrade #8
Conversation
ff25f18
to
e902583
Compare
e902583
to
572399e
Compare
@klay2000 can you give this a sanity check? No need to validate this. |
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.
Functionally seems fine, I only found a spelling error and an accidental paste in a comment I think?
- Optional[] fields need to be initialized to None to actually be parsed as optional - __fields__ -> model_fields - json() -> model_dump_json() - parse_obj() -> model_validate()
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.
Perfect 🎆
28fb82d
to
5724718
Compare
Update to a newer generation of pydantic. Initial changes followed the guide here: https://docs.pydantic.dev/latest/migration/
The major challenge here was pyamplipi's use of pydantic;'s ModelMetaclass and ModelField which were made private by the pydantic devs (for good reasons).
This code has been tested via: