Fix Dag list filtering to include QUEUED DagRuns with null start_date#52668
Merged
pierrejeambrun merged 4 commits intoapache:mainfrom Jul 7, 2025
Merged
Fix Dag list filtering to include QUEUED DagRuns with null start_date#52668pierrejeambrun merged 4 commits intoapache:mainfrom
pierrejeambrun merged 4 commits intoapache:mainfrom
Conversation
pierrejeambrun
approved these changes
Jul 7, 2025
Member
pierrejeambrun
left a comment
There was a problem hiding this comment.
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-testThis 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 |
Member
|
Whole bunch of commits to backport to be able to get that in, marking for 3.1.0. |
HsiuChuanHsu
pushed a commit
to HsiuChuanHsu/airflow
that referenced
this pull request
Jul 10, 2025
…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
stephen-bracken
pushed a commit
to stephen-bracken/airflow
that referenced
this pull request
Jul 15, 2025
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.