Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add task group ID filtering support to task instance query#58092

Merged
pierrejeambrun merged 3 commits intoapache:mainfrom
yimingpeng:fix-task-group-instance-query-with-prefix
Dec 12, 2025
Merged

Add task group ID filtering support to task instance query#58092
pierrejeambrun merged 3 commits intoapache:mainfrom
yimingpeng:fix-task-group-instance-query-with-prefix

Conversation

Copy link
Contributor

yimingpeng commented Nov 9, 2025 *
edited
Loading

closes: #55319

This PR is to address the 2nd issue of the above ticket.

Problem summary

When querying with task group name, the task instance list returns no results.

Proposed Solution

Added QueryTITaskDisplayNameOrGroupPattern filter in parameters.py that now supports

  1. The original search pattern
  2. An expansion for handling task group, when the search value matches a task group, we now query all task IDs within the group.

After Fix


^ 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 bot added area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. labels Nov 9, 2025
guan404ming reviewed Nov 12, 2025
Copy link
Member

guan404ming left a comment

Choose a reason for hiding this comment

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

Overall looks good, one nit.

yimingpeng reacted with heart emoji
jason810496 reviewed Nov 12, 2025
Copy link
Member

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 PR!

yimingpeng reacted with heart emoji
Copy link
Member

pierrejeambrun left a comment *
edited
Loading

Choose a reason for hiding this comment

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

Nice! Thank you for the pull request.

I second what has been said above.

I'm not sure if we should or shouldn't have the same filter to handle both 'task pattern search' and 'group exact search'.

If we are to mix the two, it has to at least be consistent (exact search for all, or pattern search for all).

Maybe a separate distinct filter for QueryTaskGroupFilter would avoid that confusion and be simpler. (also this would create confusion if we have a task called 'something_xxxx' and a task group also called 'something'. Giving 'something' as a task group filter to the param would both get the something_xxxx task and all tasks from the something task group, which is basically wrong from a UI perspective -> task something_xxxx would appear in the list of tasks of the something group, if I'm not mistaken)

Also I think indeed that similarly to the TI we should probably filter on group_display_name and not group_id.

The advantage of this implementation is that it doesn't require front-end change to fix the issue though.

yimingpeng reacted with thumbs up emoji
Copy link
Member

pierrejeambrun commented Dec 1, 2025

@yimingpeng That would be useful for other PRs/features too such as #58102. Any chance we can address the comment so we can move this forward?

yimingpeng reacted with thumbs up emoji

Copy link
Contributor Author

yimingpeng commented Dec 2, 2025

Hi @pierrejeambrun, apologies for the delay, just a bit swamped with some other things. I'll get this sorted within the week and thank you

pierrejeambrun reacted with thumbs up emoji

yimingpeng force-pushed the fix-task-group-instance-query-with-prefix branch from 0013d17 to d5dc5f6 Compare December 5, 2025 08:41
Copy link
Contributor Author

yimingpeng commented Dec 5, 2025

Hello @guan404ming @jason810496 @pierrejeambrun ,

Thanks for your review comments and apologise for the delay.

I think that I addressed all your feedbacks, pls help have another review when you have a chance, many thanks.

Screen.Recording.2025-12-05.at.9.11.10.PM.mov

Copy link
Member

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 update!

yimingpeng reacted with heart emoji
Copy link
Member

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 update.

I think we still need a few adjustments, and we should be good!

yimingpeng reacted with heart emoji
yimingpeng force-pushed the fix-task-group-instance-query-with-prefix branch 2 times, most recently from 017c0e4 to c0ed676 Compare December 11, 2025 08:05
Copy link
Contributor Author

yimingpeng commented Dec 11, 2025

Thanks for insightful feedback, @jason810496 @pierrejeambrun

Based on what has been suggested, I've made another update, please have another review when you have a chance, thanks .

jason810496 reviewed Dec 11, 2025
Copy link
Member

jason810496 left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for the quick update.

yimingpeng reacted with heart emoji
yimingpeng force-pushed the fix-task-group-instance-query-with-prefix branch from c0ed676 to b5837ee Compare December 12, 2025 07:04
Copy link
Contributor Author

yimingpeng commented Dec 12, 2025

Hi @jason810496, thanks for the quick review and the good suggestions, just updated accordingly.

jason810496 approved these changes Dec 12, 2025
Copy link
Member

jason810496 left a comment

Choose a reason for hiding this comment

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

Only the final nit for import then the PR is good to go.
Thanks!

yimingpeng force-pushed the fix-task-group-instance-query-with-prefix branch from b5837ee to 61ff6bb Compare December 12, 2025 08:11
pierrejeambrun approved these changes Dec 12, 2025
Copy link
Member

pierrejeambrun left a comment *
edited
Loading

Choose a reason for hiding this comment

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

Nice one LGTM.

I just pushed a nit. (renaming the filter to task_group_id to be consistent with the rest of the API)

jason810496 reacted with thumbs up emoji
pierrejeambrun added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Dec 12, 2025
pierrejeambrun added this to the Airflow 3.1.5 milestone Dec 12, 2025
pierrejeambrun merged commit 8256ee1 into apache:main Dec 12, 2025
239 of 240 checks passed
Copy link

github-actions bot commented Dec 12, 2025

Backport failed to create: v3-1-test. View the failure log Run details

Status Branch Result
v3-1-test

You can attempt to backport this manually by running:

cherry_picker 8256ee1 v3-1-test

This should apply the commit to the v3-1-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

pierrejeambrun added a commit to astronomer/airflow that referenced this pull request Dec 16, 2025
)

* Add task group ID filtering support to task instance query

* Address the review comments

* Small Adjustment

---------

Co-authored-by: pierrejeambrun
(cherry picked from commit 8256ee1)
Copy link
Member

pierrejeambrun commented Dec 16, 2025

Manual backport #59511

potiuk pushed a commit that referenced this pull request Dec 16, 2025
...59511)

* Add task group ID filtering support to task instance query

* Address the review comments

* Small Adjustment

---------


(cherry picked from commit 8256ee1)

Co-authored-by: Yiming Peng
ephraimbuddy pushed a commit that referenced this pull request Jan 6, 2026
...59511)

* Add task group ID filtering support to task instance query

* Address the review comments

* Small Adjustment

---------


(cherry picked from commit 8256ee1)

Co-authored-by: Yiming Peng
jhgoebbert pushed a commit to jhgoebbert/airflow_Owen-CH-Leung that referenced this pull request Feb 8, 2026
)

* Add task group ID filtering support to task instance query

* Address the review comments

* Small Adjustment

---------

Co-authored-by: pierrejeambrun
Subham-KRLX pushed a commit to Subham-KRLX/airflow that referenced this pull request Mar 4, 2026
)

* Add task group ID filtering support to task instance query

* Address the review comments

* Small Adjustment

---------

Co-authored-by: pierrejeambrun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

jason810496 jason810496 approved these changes

guan404ming guan404ming left review comments

pierrejeambrun pierrejeambrun approved these changes

bbovenzi Awaiting requested review from bbovenzi bbovenzi is a code owner

ryanahamilton Awaiting requested review from ryanahamilton ryanahamilton is a code owner

shubhamraj-git Awaiting requested review from shubhamraj-git shubhamraj-git is a code owner

ephraimbuddy Awaiting requested review from ephraimbuddy ephraimbuddy is a code owner

rawwar Awaiting requested review from rawwar rawwar is a code owner

bugraoz93 Awaiting requested review from bugraoz93 bugraoz93 is a code owner

Assignees

No one assigned

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

Projects

None yet

Milestone

Airflow 3.1.5

Development

Successfully merging this pull request may close these issues.

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

4 participants