Replies: 2 comments 2 replies
-
After a hard deep dive debug, I think this issue is caused by the change of/from python 3.10 with annotation future as default. def get_typed_signature(call: Callable[..., Any]) -> inspect.Signature:
signature = inspect.signature(call, eval_str=True)
...
|
Beta Was this translation helpful? Give feedback.
2 replies
-
I am having a similar problem but this happens within my docker container.
The code that causes this is in a file called # the config is set in the server.py's create_app method.
# see https://fastapi.tiangolo.com/advanced/settings/#settings-in-a-dependency
@lru_cache(maxsize=1)
def get_settings(request: Request) -> SvcSettings:
return request.app.state.config If I remove the annotation it works fine. |
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
-
First Check
Commit to Help
Example Code
Description
The code can run with any problem with pure python.
Run python setup.py build_ext to compile the test.py to test.so
Run uvicorn test:init
Failed with pydantic.errors.PydanticUndefinedAnnotation: name 'Request' is not defined
If remove call method, it’s ok again.
Operating System
Linux, macOS
Operating System Details
No response
FastAPI Version
0.103.0
Pydantic Version
2.3.0
Python Version
3.11
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions