pierrejeambrun commented on PR #55253: URL: https://github.com/apache/airflow/pull/55253#issuecomment-3258259719
I am not in favor of this. The FastAPI interface expects a factory middleware object and the airflow API therefore expose the same. Documentation is clear about that: ``` + # A list of dictionaries containing FastAPI middleware factory objects and some metadata. See the example below. + fastapi_root_middlewares = [] ``` I don't think we should add code to try to dynamically resolve stuff as it will bring additional complexity and most likely won't work in all cases. Also this won't fix the problem because if the import resolution fail, the `ImportError` will still crash the API server, which is what we want to avoid. On the other hand to fix https://github.com/apache/airflow/issues/55176 I think we can simply add a check and verify that the factory is callable, and that the returned object is an instance of FastAPI middleware before moving forward. -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org