Use is_valid_field from 1.x for mypy plugin#8738
Use is_valid_field from 1.x for mypy plugin#8738sydney-runkle merged 2 commits intopydantic:mainfrom DanielNoord:patch-1
is_valid_field from 1.x for mypy plugin#8738Conversation
CodSpeed Performance ReportMerging #8738 will not alter performanceComparing Summary
|
|
please review I think the last failing test can be skipped by adding the correct label? It doesn't feel like this requires a changelog? |
|
In general I think we want to avoid changing the 1.X module code as much as possible. Does it not work to change: from pydantic.utils import is_valid_fieldto ? |
|
@dmontagu It should. Added a second commit to fix this, thanks! Edit: For some reason CI fails. I can't really reproduce that environment locally easily. David would you mind rerunning CI and seeing if that fixes it? I don't see why PyPy3.10 should fail on this.. |
sydney-runkle
left a comment
There was a problem hiding this comment.
Wonderful, thanks!
|
@sydney-runkle Any reason why this fix is not included in the latest releases? The backport to |
|
This should be included in 2.7! Thanks for the ping :). |
Change Summary
pydantic/pydantic/utils.py
Lines 696 to 699 in 3ddb509
This brings the
mypyplugin in thev1namespace in line with how1.xactually behaved.Importing this from the
pydanticnamespace created warnings in our v1/v2 codebase.Related issue number
No issue, couldn't find one and this seems like a simple enough change.
Checklist
Selected Reviewer: @sydney-runkle
skip change file check