tirkarthi commented on issue #58983:
URL: https://github.com/apache/airflow/issues/58983#issuecomment-3611606444

   https://github.com/fastapi/fastapi/pull/11355 released in fastapi==0.123.7 
breaks with `from __future__ import annotations` in Python 3.11 . I have 
reported the same in the PR. fastapi==0.123.6 works for now.
   
   ```python
   from __future__ import annotations
   
   import uuid
   from typing import TYPE_CHECKING, Annotated
   from fastapi import Depends, Request, FastAPI
   from pydantic import BaseModel
   from fastapi.security import HTTPBearer
   
   if TYPE_CHECKING:
       from fastapi.security import HTTPAuthorizationCredentials
   
   
   class UserResource(BaseModel):
       id: uuid.UUID
       address: str
   
   
   app = FastAPI()
   bearer_scheme = HTTPBearer(auto_error=False)
   
   
   async def get_user(
       bearer_credentials: HTTPAuthorizationCredentials | None = None,
   ) -> str:
       return "user"
   
   @app.get("/users", dependencies=[Depends(get_user)])
   def get_user() -> UserResource:
       id_ = uuid.uuid4()
       return UserResource(id=id_, address="a")
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to