vikrantkumar-max commented on code in PR #55253:
URL: https://github.com/apache/airflow/pull/55253#discussion_r2324942760
##########
airflow-core/src/airflow/api_fastapi/app.py:
##########
@@ -200,5 +200,17 @@ def init_plugins(app: FastAPI) -> None:
log.error("'middleware' key is missing for the fastapi middleware:
%s", name)
continue
+ # Resolve middleware string to class if needed
+ if isinstance(middleware, str):
+ try:
+ from airflow.utils.module_loading import import_string
+ middleware = import_string(middleware)
Review Comment:
Yes it will convert string in python Class ,
You have to put the Class like this
"middleware": "my_plugin_name.AddHeaderMiddleware", then 207 will work
if you put
"middleware": "AddHeaderMiddleware", then 210 line will execute
it will find class in whole plugins folder
--
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]