Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions airflow-core/newsfragments/69769.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix DAG details 'active runs' count to only include running runs, not queued ones, matching scheduler enforcement of max_active_runs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def get_dag_details(
session.scalar(
select(func.count())
.select_from(DagRun)
.where(DagRun.dag_id == dag_id, DagRun.state.in_([DagRunState.RUNNING, DagRunState.QUEUED]))
.where(DagRun.dag_id == dag_id, DagRun.state == DagRunState.RUNNING)
)
or 0
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ def test_dag_details_includes_active_runs_count(self, session, test_client):
# Verify active_runs_count field is present and correct
assert "active_runs_count" in body
assert isinstance(body["active_runs_count"], int)
assert body["active_runs_count"] == 2 # 1 running + 1 queued
assert body["active_runs_count"] == 1 # only running counts, queued does not

# Test with DAG that has no active runs
response = test_client.get(f"/dags/{DAG1_ID}/details")
Expand Down