-
Notifications
You must be signed in to change notification settings - Fork 15.9k
Fix executor field not populated for tasks without explicit executor #57590
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
45591e5 to
2b918e7
Compare
2b918e7 to
c7be733
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.
Awesome! works like a charm!
When a task doesn't specify an executor, the executor field in the database remained `NULL`, causing it to not display in the UI. This fix resolves the executor to the default configured executor name at task instance creation and refresh time, following the same pattern as other fields like pool and queue. The fix modifies TaskInstance.insert_mapping() and TaskInstance.refresh_from_task() to automatically populate the executor field with the default executor when task.executor is None, ensuring the field always displays correctly in the UI. closes apache#57526
c7be733 to
e7b5533
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.
Looks good, one sanity question
|
|
||
| executor = task.executor | ||
| if executor is None: | ||
| executor_name = ExecutorLoader.get_default_executor_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.
As we call on task instance potentially often and there is a bunch of logic behind this - but w/o DB access - to wire up executor details... should the called get_default_executor_name() method being implement the @cache decorator?
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.
@jscheffl, would this return the right executor in a multi executor context?
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.
If the executor field is None then the default executor is used during execution - so the logic on API for display is consistent here. If the field on the TaskInstance is filled, then it references to the executor that specifically is wanted.
When a task doesn't specify an executor, the executor field in the database remained
NULL, causing it to not display in the UI. This fix resolves the executor to the default configured executor name at task instance creation and refresh time, following the same pattern as other fields like pool and queue.The fix modifies TaskInstance.insert_mapping() and TaskInstance.refresh_from_task() to automatically populate the executor field with the default executor when task.executor is None, ensuring the field always displays correctly in the UI.
closes #57526
Same screenshots as #57526 :)
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.