-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
🐛 Fix internal Pydantic v1 compatibility (warnings) for Python 3.14 and Pydantic 2.12.1 #14186
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
Merged
+283
−102
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
📝 Docs previewLast commit b7d4d4c at: https://ffdce6a4.fastapitiangolo.pages.dev Modified Pages |
# Conflicts: # fastapi/_compat/may_v1.py
svlandeg
commented
Oct 15, 2025
tiangolo
approved these changes
Oct 20, 2025
Member
tiangolo
left a comment
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.
Awesome, thank you @svlandeg! 🙌
I checked and confirmed that on Python 3.14, if users try to use Pydantic v1 they still get a warning on their own code, but not on older versions. So we're good to go! 🚀
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Python 3.14 tests started failing with the Pydantic v.2.12.1 release, because of the combination of #14168 and pydantic/pydantic#12367.
Basically we were importing Pydantic
v1functionality even when the user had (only) Pydantic v2 installed. This was done in #14168 to support more easy migration from v1 to v2 by allowing mixing versions within the same app.Here, we prevent importing any
v1functionality by creating dummy classes for Python 3.14 / Pydantic 2.12.0 onwards, which drops support forv1and emits a warning when importingv1functionality.TODO