henry3260 commented on code in PR #65587:
URL: https://github.com/apache/airflow/pull/65587#discussion_r3394443014
##########
airflow-core/src/airflow/api_fastapi/execution_api/app.py:
##########
@@ -390,14 +403,20 @@ async def always_allow(request: Request):
return self._app
+ @cached_property
+ def asgi_app(self) -> Any:
Review Comment:
> nit: Can we have a better typing than `Any`? That would improve downstream
static checks. Easiest might be making `_RequestScopedServerContextApp` a
subclass of `FastAPI`?
Thanks for the suggestion. I replaced the `Any` annotations with Starlette's
`Scope`, `Receive`, `Send`, and typed asgi_app as ASGIApp.
I kept `_RequestScopedServerContextApp `as an ASGI wrapper instead of
subclassing FastAPI, because it delegates requests to an existing FastAPI app
and does not initialize or expose its own router, state, or lifespan.
Subclassing FastAPI would therefore imply functionality the wrapper does not
actually provide.
--
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]