-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Pydantic generic models fail to generate schema with typing-extensions 4.12 TypeVar #9499
Comments
Hmm, what error are you getting @strangemonad? I'm not seeing an error with my local testing... |
@sydney-runkle it might be that #2426 (released in pydantic 2.7.2?) indirectly fixes the issue? I don't think this specific case was added to any tests in #2426 and it might be good to have some sort of test that's able to exhaustively run through all or most types in typing extensions to catch these automatically or fail if there are new types in a new version of typing extensions that aren't tested yet? with
I get the following
|
Did you mean to link #2426? I don't think that was released in 2.7.2... |
Ah, probably #9426 :) |
Definitely possible. Going to mark this as resolved, as it's no longer an issue in more recent versions. @strangemonad, feel free to open a PR with those additional test cases, I'd be happy to review! |
Initial Checks
Description
typing-extensions 4.12 adds support for PEP696 default type params.
If a generic model uses typing extensions 4.12 TypeVar, the model class fails to be created.
Related to #9426. Consider preventing typing-extensions 4.12 (capped to 4.11) in older pydantic dot-releases
Example Code
The text was updated successfully, but these errors were encountered: