Skip to content

Show the filtered task count in the Dag Tasks tab heading - #75448

Merged
bbovenzi merged 1 commit into
apache:mainfrom
nanheekim-ovo:fix/dag-tasks-filtered-row-count
Oct 23, 2026
Merged

bbovenzi merged 1 commit into
apache:mainfrom
nanheekim-ovo:fix/dag-tasks-filtered-row-count

Conversation

@nanheekim-ovo

@nanheekim-ovo nanheekim-ovo commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

On the Dag page, the Tasks tab filters the task list client-side (operator, trigger rule, retries, mapped, and the name search box), but the row-count heading above the table was fed the API's total_entries. The heading therefore never changed as filters narrowed the list: with 12 tasks in the Dag and a search that leaves a single row, it still read "12 Tasks"!

The total line predates the filters (#44604); client-side filtering was added in #54484 without touching it, and the heading became default-on in #57680, which is when the mismatch became visible.

How

This passes filteredTasks.length as the DataTable total instead, so the heading follows the rows the table shows. That matches Configs.tsx and VersionDiff.tsx, which already pass the length of a client-built list. GET /dags/{dag_id}/tasks only accepts order_by and returns every task with total_entries = len(tasks), so nothing else on this page depended on the server total, and the Tasks tab has no offset pagination that could be affected.

The existing filter tests now also assert the heading count after each filter and after a name search; they fail on main and pass with this change.

Observed on Airflow 3.2.2; the same line is on main.

Local results

Before PR screenshots

before_all before_operator_bash before_search_runme

After PR screenshots

after_all after_operator_bash after_search_runme

Since this is my first time, there may be some shortcomings.
Please let me know if any parts need revision or if I should submit a PR to a different branch.
Thank you!


Was generative AI tooling used to co-author this PR?
  • Yes (Claude Code Fable 5.1 Use)

The Tasks tab filters the task list client-side (operator, trigger rule,
retries, mapped, name search) but passed the API's total_entries to the
DataTable heading, so the heading kept reporting the unfiltered count
("12 Tasks") even when a search narrowed the list to a single task.
Pass the filtered list's length instead, as Configs.tsx already does for
its client-built list, and assert the count in the existing filter tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Oct 23, 2026
@boring-cyborg

boring-cyborg Bot commented Oct 23, 2026

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@choo121600 choo121600 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch! Thanks

@choo121600 choo121600 added the backport-to-v3-4-test Backport to v3-4-test label Oct 23, 2026
@bbovenzi bbovenzi added this to the Airflow 3.4.0 milestone Oct 23, 2026
@bbovenzi
bbovenzi merged commit 99bdeab into apache:main Oct 23, 2026
79 checks passed
@boring-cyborg

boring-cyborg Bot commented Oct 23, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-4-test PR Link

vatsrahul1001 pushed a commit that referenced this pull request Oct 24, 2026
…#75448)

The Tasks tab filters the task list client-side (operator, trigger rule,
retries, mapped, name search) but passed the API's total_entries to the
DataTable heading, so the heading kept reporting the unfiltered count
("12 Tasks") even when a search narrowed the list to a single task.
Pass the filtered list's length instead, as Configs.tsx already does for
its client-built list, and assert the count in the existing filter tests.
(cherry picked from commit 99bdeab)

Co-authored-by: 김난희 <nanhee.kim@ishopcare.co.kr>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
vatsrahul1001 pushed a commit that referenced this pull request Oct 24, 2026
…#75448) (#75490)

The Tasks tab filters the task list client-side (operator, trigger rule,
retries, mapped, name search) but passed the API's total_entries to the
DataTable heading, so the heading kept reporting the unfiltered count
("12 Tasks") even when a search narrowed the list to a single task.
Pass the filtered list's length instead, as Configs.tsx already does for
its client-built list, and assert the count in the existing filter tests.
(cherry picked from commit 99bdeab)

Co-authored-by: 김난희 <nanhee.kim@ishopcare.co.kr>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-4-test Backport to v3-4-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants