Repository navigation
fix Support Pydantic validators in Annotated fields #4256 - #4282
asukaminato0721 wants to merge 1 commit into
Conversation
This comment has been minimized.
This comment has been minimized.
|
This pull request has been imported. If you are a Meta employee, you can view this in D114356273. (Because this pull request was imported automatically, there will not be any future comments.) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ebae9ed to
22b4e21
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
|
Unfortunately, I think this has the same issue as #3798 - it works through
IMO a more promising way forward would be to modify just |
Summary
Fixes #4256
BeforeValidator and PlainValidator constructor input inference.
Support across reusable TypeAlias annotations.
Correct right-to-left ordering for chained before validators, matching Pydantic's behavior (https://pydantic.dev/docs/validation/latest/concepts/validators/#ordering-of-validators).
Support for fields with defaults while preserving the stored field type.
Test Plan
add test