Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Error is reproducible with Pydantic 2.8.2, but everything is Ok with Pydantic 2.9+. Let's close this for now to keep the discussions clean. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
Running a simple example with a POST endpoint that expects a request parameter defined by a TypedDict class results in an error within Pydantic about
Trying to dig into the issue more lead me to see that the
Requiredattribute / import is being redefined as PydanticUndefined in the file hereWhen importing types defined by other modules / classes it isn't always possible to change.
If you run the above, but remove the
from __future__ import annotations, the code runs and performs as expected.Not sure why the futures import causes issues here, but with this I am unable to use classes / datatypes defined in other modules that make use of this python feature.
Operating System
Linux
Operating System Details
No response
FastAPI Version
0.112.0
Pydantic Version
2.8.2
Python Version
Python 3.12.2
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions