Skip to content

Conversation

@OscarLigthart
Copy link
Contributor

Following PR #57237, @bbovenzi gave me a piece of feedback that we should try to avoid fetching all of the tasks a second time and then iterating through them all again on the frontend. Instead, we should add the filter parameters to the existing grid structure endpoint. Keeping scopes of PRs small, I decided to do it in separate PR.

Enter this PR, which introduces exactly that. It simplifies the frontend Grid behaviour in favour of implementing the filter logic in the backend.


^ 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 area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. labels Nov 22, 2025
@OscarLigthart OscarLigthart force-pushed the refactor/move-task-filtering-logic-to-endpoints branch from 2ca6130 to fed6a07 Compare November 27, 2025 12:46
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.

Nice, thanks for the pull request. 🎉

Do you mind updating the tests for the backend endpoint (structure), for these newly added query parameters? (with a few different combinations)

@OscarLigthart OscarLigthart force-pushed the refactor/move-task-filtering-logic-to-endpoints branch 2 times, most recently from 92c71db to cdfa245 Compare December 3, 2025 10:41
@OscarLigthart
Copy link
Contributor Author

OscarLigthart commented Dec 3, 2025

Do you mind updating the tests for the backend endpoint (structure), for these newly added query parameters? (with a few different combinations)

Great point 👍 Adding the test actually showed me that I forgot to account for the retrieval of historical tasks. To make the code a bit clearer, I moved that part to services.

I thought it would make sense to refrain from retrieving historical tasks in case of filtering the DAG. Let me know whether you agree or not!

@OscarLigthart OscarLigthart force-pushed the refactor/move-task-filtering-logic-to-endpoints branch from 32b6a76 to 0295804 Compare December 4, 2025 09:34
@bbovenzi bbovenzi added this to the Airflow 3.2.0 milestone Dec 4, 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.

Looking good.

Just one question to clarify before we can merge.

@OscarLigthart OscarLigthart force-pushed the refactor/move-task-filtering-logic-to-endpoints branch 6 times, most recently from 9f13179 to 5efe698 Compare December 15, 2025 22:15
@OscarLigthart OscarLigthart force-pushed the refactor/move-task-filtering-logic-to-endpoints branch from 5efe698 to 2752bfb Compare December 16, 2025 07:53
@pierrejeambrun
Copy link
Member

Thanks @OscarLigthart! 🎉

@pierrejeambrun pierrejeambrun merged commit fb12e5c into apache:main Dec 18, 2025
125 checks passed
Lohith625 pushed a commit to Lohith625/airflow that referenced this pull request Dec 19, 2025
…he#58576)

* refactor: move task stream filtering logic to endpoint for Grid

* fix: lint

* feat: add tests for stream filter in grid

* fix: historical task filtering

* fix: return value for collect_historical_tasks

* fix: remove duplicate historical task retrieval and add historical task to test case
stegololz pushed a commit to stegololz/airflow that referenced this pull request Jan 9, 2026
…he#58576)

* refactor: move task stream filtering logic to endpoint for Grid

* fix: lint

* feat: add tests for stream filter in grid

* fix: historical task filtering

* fix: return value for collect_historical_tasks

* fix: remove duplicate historical task retrieval and add historical task to test case
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants