-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Fix stats of dynamic mapped tasks after automatic retries of failed tasks #44300
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try_number for dynamic mapped tasks
jscheffl
approved these changes
Nov 23, 2024
Contributor
jscheffl
left a comment
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 was reading the text multiple times and still have trouble understanding the query logic... but I can confirm it fixes the problem.
eladkal
approved these changes
Nov 23, 2024
potiuk
approved these changes
Nov 24, 2024
Member
potiuk
left a comment
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.
NICE!
potiuk
pushed a commit
that referenced
this pull request
Nov 24, 2024
…amic mapped tasks (#44300) (#44319) * [v2-10-test] Avoid grouping task instance stats by try_number for dynamic mapped tasks (#44300) (cherry picked from commit 5e52bd2) Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com> * Update test_views_grid.py --------- Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com>
utkarsharma2
pushed a commit
that referenced
this pull request
Dec 4, 2024
…amic mapped tasks (#44300) (#44319) * [v2-10-test] Avoid grouping task instance stats by try_number for dynamic mapped tasks (#44300) (cherry picked from commit 5e52bd2) Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com> * Update test_views_grid.py --------- Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com>
utkarsharma2
pushed a commit
that referenced
this pull request
Dec 9, 2024
…amic mapped tasks (#44300) (#44319) * [v2-10-test] Avoid grouping task instance stats by try_number for dynamic mapped tasks (#44300) (cherry picked from commit 5e52bd2) Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com> * Update test_views_grid.py --------- Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com>
got686-yandex
pushed a commit
to got686-yandex/airflow
that referenced
this pull request
Jan 30, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area:dynamic-task-mapping
AIP-42
area:webserver
Webserver related Issues
type:bug-fix
Changelog: Bug Fixes
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes: #44245
Cause
The query for fetching the stats of task instances groups them by
task_id,run_id,state, andtry_number. However, usingtry_numberfor dynamic mapped tasks leads to incorrect results as individual tasks within the mapping might have differenttry_numbervalues.Example
Let's say that within a dynamic mapped task there were 10 expansions - 4 of them failed in the first time and reran (i.e.,

try_number = 2).In this case, the API response will eventually show only statistics regarding the most recent
try_number.Note
Intermediate results might not exactly follow the latter pattern, as they also depend on the
TaskInstance.stateparameter of thegroup_by.Solution
In the query, avoid grouping by
try_numberonly for dynamic mapped tasks (map_index != -1).^ 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 newsfragments.