-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Migrate DagFileProcessorManager._deactivate_stale_dags to Internal API #28476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d6acb64 to
f10c9a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two small nits. Thanks!
| output = handler(**params) | ||
| output = handler( | ||
| **params, | ||
| log=logging.getLogger(f"airflow.internal_api.{method_name}"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work if the method doesn't have "log" parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! That's a good point! I guess not. I dont think we should handle logs this way then. The simplest way would be to create a logger log = logging.getLogger(__name__) in airflow/dag_processing/manager.py and use this logger in static methods. The only downside is the logger would be the same whether or not internal API in turn on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hoped that we can detect that the method has "log" argument and add it then.
If it's not possible to detect then we can send addition parameter from client(like "inject_log=true") and when seen on server-side then add "log" to params
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented a solution which detects if the parameter "log" exists. If it does, then provide one specific to internal API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Thanks!
|
I guess that one should be updated after discussion in #28502 with |
|
PR updated :) |
Migrate
DagFileProcessorManager._deactivate_stale_dagsto Internal API. Please while reviewing it to pay double attention to how I handle the logs. When discussing with @mhenc, we decided:Very happy to hear your feedback and/or suggestions since, to be very honest, I am not a big fan of passing the logger as parameter
Closes #28270