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

pierrejeambrun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new dc73d38a36c Add number of queries guard in public dags list endpoints 
(#57506)
dc73d38a36c is described below

commit dc73d38a36c9d1e532ee76a990027b5c90dd2166
Author: Pierre Jeambrun <[email protected]>
AuthorDate: Thu Oct 30 14:42:51 2025 +0100

    Add number of queries guard in public dags list endpoints (#57506)
---
 .../tests/unit/api_fastapi/core_api/routes/public/test_dags.py       | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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 94482a3b0aa..cb59ec3ec43 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
@@ -31,7 +31,7 @@ from airflow.providers.standard.operators.empty import 
EmptyOperator
 from airflow.utils.state import DagRunState, TaskInstanceState
 from airflow.utils.types import DagRunTriggeredByType, DagRunType
 
-from tests_common.test_utils.asserts import count_queries
+from tests_common.test_utils.asserts import assert_queries_count, count_queries
 from tests_common.test_utils.db import (
     clear_db_assets,
     clear_db_connections,
@@ -441,7 +441,8 @@ class TestGetDags(TestDagEndpoint):
         if any(param in query_params for param in ["has_asset_schedule", 
"asset_dependency"]):
             self._create_asset_test_data(session)
 
-        response = test_client.get("/dags", params=query_params)
+        with assert_queries_count(4):
+            response = test_client.get("/dags", params=query_params)
         assert response.status_code == 200
         body = response.json()
 

Reply via email to