This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-1-test by this push:
new 59d8710bb94 [v3-1-test] Add number of queries guard in public dag
warnings list endpoint (#57503) (#57546)
59d8710bb94 is described below
commit 59d8710bb94b4f6af076af1254cc3f570c7246ec
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Oct 30 20:44:02 2025 +0000
[v3-1-test] Add number of queries guard in public dag warnings list
endpoint (#57503) (#57546)
(cherry picked from commit a70aed1ead0a11b7047e25a5fa59be0db4d2a564)
Co-authored-by: Pierre Jeambrun <[email protected]>
---
.../tests/unit/api_fastapi/core_api/routes/public/test_dag_warning.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_warning.py
b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_warning.py
index 766c2dda4ac..45f08f95d1e 100644
---
a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_warning.py
+++
b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_warning.py
@@ -23,6 +23,7 @@ from airflow.models.dag import DagModel
from airflow.models.dagwarning import DagWarning
from airflow.utils.session import provide_session
+from tests_common.test_utils.asserts import assert_queries_count
from tests_common.test_utils.db import clear_db_dag_warnings, clear_db_dags
pytestmark = pytest.mark.db_test
@@ -88,7 +89,8 @@ class TestGetDagWarnings:
],
)
def test_get_dag_warnings(self, test_client, query_params,
expected_total_entries, expected_messages):
- response = test_client.get("/dagWarnings", params=query_params)
+ with assert_queries_count(3):
+ response = test_client.get("/dagWarnings", params=query_params)
assert response.status_code == 200
response_json = response.json()
assert response_json["total_entries"] == expected_total_entries