-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix warnings from pydantic #3670
Fix warnings from pydantic #3670
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -84,3 +84,5 @@ version_files = [ | |||
"pyproject.toml:^version" | |||
] | |||
|
|||
[tool.mypy] | |||
plugins = "pydantic.mypy" |
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.
mypy treats model_config
assignment as an unintended override -- when it is.
Adding the pydantic mypy plugin seems to solve this problem. https://docs.pydantic.dev/latest/integrations/mypy/
After adding this:
mypy . --ignore-missing-imports | grep "Cannot override class variable (previously declared on base class "BaseModel") with instance variable" return zero lint errors relating to overring class variaables.
i believe this fixes this #3670 (comment) |
@krrishdholakia can confirm it works on my machine. |
Thanks! This is really cogging our CI logs. :( |
7c83fd0
to
27ed724
Compare
Merged new changes and updated one pesky Hands tied here for the CI since: |
Merging in - i'll let you know if there's any issues on ci/cd @lj-wego Thank you again for your help here! |
@krrishdholakia litellm/.circleci/requirements.txt Line 10 in deb87f7
|
Added a PR here to address this. Unless this is reverted 😓 |
Attempt to fix pydantic warnings.
before:
after:
running same test as #3600:
Not fixing the import lib warning as it is not explicitly related to pydantic.
Regarding pydantic v1 compatibility
#3600 (comment)
Openai (1.25.1) is using pydantic v2
https://github.com/openai/openai-python/blob/aed1e43745cd6358b4bafd3a39b3dfeee5e31a03/requirements.lock#L40
Relevant issues
Fixes #3417
#3600
#3664
Type
🐛 Bug Fix
🧹 Refactoring