-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Improve Pydantic v1/2 cross-compatibility #101
Conversation
This may be a crude solution to comply with Pydantic 1.x. I'll leave it upto you @cthoyt, to disregard PR or merge it. |
@hrshdhgd do you know if there's a pydantic compatibility layer package (like |
I think as per pydantic docs, there is |
I ran I also undid everything from this PR and ran
|
Welcome to Codecov 🎉Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment. Thanks for integrating Codecov - We've got you covered ☂️ |
@validator
decorator to @field_validator
since the former will be deprecated/removed in future versions.
@hrshdhgd that wasn't what I was thinking - rather, I was wondering if there was re-usable code that wraps the logic for writing cross-compatible pydantic models, not if there was code for upgrading i found https://github.com/pyapp-kit/pydantic-compat btw, seems a bit heavy so for now I think we can just keep a small compatibility layer internal in |
Update
@validator
decorator to@field_validator
since the former will be deprecated/removed in future versions.Warning that triggered this PR:
Solution:
~@validator~ => @field_validator