Skip to content

Conversation

@yimingpeng
Copy link
Contributor

@yimingpeng yimingpeng commented Sep 15, 2025

closes: #55319

Problem Summary

When checking the status of a task group in the grid view:

  1. The header only shows the # of abstract tasks in mapped task group (e..g, 3 tasks instead of 40 tasks).
  2. The task instances list has no results. (This will be addressed in a separate MR)

Proposed Solution

For Issue 1

  • When child nodes have child_states (mapped tasks), now we expand and count each state of individual task instances rather than treating them as one abstract task

### For Issue 2
- First we check whether the task name pattern is a task group ID
- Next we resolve this pattern to all task ids within the group
- So whenever we encounter a task group, we query task instances by filtering on the task ids extracted from last step other than using the original name pattern.

After the Fix

Screen.Recording.2025-09-17.at.9.04.56.PM.mp4

Running result on 2025-10-29

image

^ 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.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@boring-cyborg boring-cyborg bot added the area:API Airflow's REST/HTTP API label Sep 15, 2025
@yimingpeng yimingpeng force-pushed the fix-task-instance-display-in-task-group-grid-view branch from 3397e14 to 8a70414 Compare September 17, 2025 09:07
@yimingpeng yimingpeng marked this pull request as ready for review September 17, 2025 10:00
@pierrejeambrun pierrejeambrun added the area:UI Related to UI/UX. For Frontend Developers. label Sep 23, 2025
@pierrejeambrun pierrejeambrun added this to the Airflow 3.1.1 milestone Sep 23, 2025
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

A few comments to address.

For 1 - I think it's nice just a few comments but we're almost there.

For 2 - I think there is a problem. Basically the issue comes from prefix_group_id=False in the group definition of the Dag. And could be also caused by overriding the display_name of tasks contained in the group. Because we are searching over task_display_name and the only way it will match is if the group id prefix is contained in the field we are filtering on the db side. The implementation you made here is not great because it's not handled on the db side but use the serialized dag and also because it mixes 'task_display_namesearch andtask_id` search. I would split this PR and move 2 - changes to a different PR so it doesn't block this one.

@kaxil kaxil modified the milestones: Airflow 3.1.1, Airflow 3.1.2 Oct 21, 2025
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yimingpeng Any chance you can address the comments so we can go ahead and merge resolution for 1?

@yimingpeng
Copy link
Contributor Author

Hi @pierrejeambrun , yes and sorry, a bit busy lately, will work on this soonish, thanks 🙏

@yimingpeng yimingpeng force-pushed the fix-task-instance-display-in-task-group-grid-view branch 2 times, most recently from 463273b to f0b38a4 Compare October 29, 2025 09:19
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking nice, just one nit and we should be good to go.

@pierrejeambrun pierrejeambrun added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Oct 30, 2025
Copy link
Member

@jason810496 jason810496 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@yimingpeng yimingpeng force-pushed the fix-task-instance-display-in-task-group-grid-view branch from f0b38a4 to e3f1276 Compare October 31, 2025 02:49
@kaxil kaxil merged commit 07d2892 into apache:main Oct 31, 2025
114 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 31, 2025
(cherry picked from commit 07d2892)

Co-authored-by: Yiming Peng <yimingpengjojo@gmail.com>
closes: #55319
@github-actions
Copy link

Backport successfully created: v3-1-test

Status Branch Result
v3-1-test PR Link

github-actions bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Oct 31, 2025
…55670)

(cherry picked from commit 07d2892)

Co-authored-by: Yiming Peng <yimingpengjojo@gmail.com>
closes: apache#55319
kaxil pushed a commit that referenced this pull request Oct 31, 2025
kaxil pushed a commit that referenced this pull request Oct 31, 2025
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Nov 10, 2025
Copilot AI pushed a commit to jason810496/airflow that referenced this pull request Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task Instances not correctly displayed in task group header in grid view

5 participants