-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Fix Dag list filtering to include QUEUED DagRuns with null start_date #52668
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
Conversation
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.
LGTM, working as expected, just one suggestion.
Backport failed to create: v3-0-test. View the failure log Run details
You can attempt to backport this manually by running: cherry_picker 6f295a4 v3-0-test This should apply the commit to the v3-0-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continue |
Whole bunch of commits to backport to be able to get that in, marking for 3.1.0. |
…apache#52668) * Fix inconsistent queued DAG filtering between dashboard and list page * Fix Dag list filtering to include DagRuns with null start_date * Remove unnecessary @provide_session decorators from test_dags.py
…apache#52668) * Fix inconsistent queued DAG filtering between dashboard and list page * Fix Dag list filtering to include DagRuns with null start_date * Remove unnecessary @provide_session decorators from test_dags.py
Summary
This pull request fixes an inconsistency where Dags with queued DAG runs were correctly counted in the dashboard stats, but not shown in the Dag list page when using the last_dag_run_state=queued filter.
Why?
When users clicked on the "Queued Dags" stat in the dashboard, they were redirected to the Dag list view, but the page displayed "No Dag found" despite the presence of queued Dags.
This resulted in a confusing and inconsistent user experience between the dashboard and the list view.
Screen.Recording.2025-07-02.at.2.11.19.AM.mov
Additional context
The root cause appears to be related to Dags that are not "activated" in the UI — specifically, Dags with start_date = null (i.e., never scheduled), but were manually triggered and entered the queued state.
While these Dags have valid Dag runs in the queued state and are counted in the dashboard, the Dag list page excludes them due to how the filter is applied.
This PR adjusts the filtering logic so that the Dag list accurately reflects the Dags shown in the dashboard stats.
Screen.Recording.2025-07-02.at.4.31.05.AM.mov
Test Coverage
Added comprehensive unit tests for generate_dag_with_latest_run_query function to ensure proper handling of QUEUED DagRuns with start_date = null.
closes: #52655
^ 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.