This is an automated email from the ASF dual-hosted git repository.

pierrejeambrun pushed a commit to branch v3-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-3-test by this push:
     new 043b3ab0984 [v3-3-test] Fix DAG details active runs count to exclude 
queued runs (#69769) (#70511)
043b3ab0984 is described below

commit 043b3ab0984ab2e1b730d293c0dbe1652db25886
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Jul 27 14:16:57 2026 +0200

    [v3-3-test] Fix DAG details active runs count to exclude queued runs 
(#69769) (#70511)
    
    * Fix DAG details active runs count to exclude queued runs
    
    * Remove newsfragment
    
    ---------
    (cherry picked from commit 66ea88f0bea478aaa10a405603d7f8f52275210d)
    
    Co-authored-by: VishwasPatel 
<[email protected]>
    Co-authored-by: pierrejeambrun <[email protected]>
---
 airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py     | 2 +-
 airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dags.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py 
b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
index 355ce4ca7a5..69b6b2932f0 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
@@ -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
     )
diff --git 
a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dags.py 
b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dags.py
index f3a3eef61c0..eb5d4a9f918 100644
--- a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dags.py
+++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dags.py
@@ -1249,7 +1249,7 @@ class TestDagDetails(TestDagEndpoint):
         # 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")

Reply via email to