-
Notifications
You must be signed in to change notification settings - Fork 280
Fix type-checking when using deprecated FieldValidationInfo
#995
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,10 @@ def foo(bar: str) -> None: | |
... | ||
|
||
|
||
def validator_deprecated(value: Any, info: core_schema.FieldValidationInfo) -> None: | ||
... | ||
Comment on lines
+26
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure that we're running mypy on this. Does this fail before the source change? Might be worth pushing a commit without the source change to see CI fail. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think only Pyright runs on this file and it was failing after adding the test but before adding the fix. To my knowledge, mypy runs only stubtests. |
||
|
||
|
||
def validator(value: Any, info: core_schema.ValidationInfo) -> None: | ||
... | ||
|
||
|
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.
FWIW according to https://peps.python.org/pep-0702/#deprecation-of-modules-and-attributes there is no way to mark a module-level attribute as deprecated for typing purposes so this is the best we can do.