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 fcf6d936bf3 [v3-1-test] Add number of queries guard in public import
errors list endpoints (#57557) (#57569)
fcf6d936bf3 is described below
commit fcf6d936bf39d77e93836a1940a038f99f541067
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Oct 30 20:43:26 2025 +0000
[v3-1-test] Add number of queries guard in public import errors list
endpoints (#57557) (#57569)
(cherry picked from commit 9ea11a36767faa65ea9a7878628ce6abe2fe40e6)
Co-authored-by: Pierre Jeambrun <[email protected]>
---
.../unit/api_fastapi/core_api/routes/public/test_import_error.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git
a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_import_error.py
b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_import_error.py
index 173e57592e4..2b7c72e8646 100644
---
a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_import_error.py
+++
b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_import_error.py
@@ -27,6 +27,7 @@ from airflow.models.dagbundle import DagBundleModel
from airflow.models.errors import ParseImportError
from airflow.utils.session import NEW_SESSION, provide_session
+from tests_common.test_utils.asserts import assert_queries_count
from tests_common.test_utils.db import clear_db_dag_bundles, clear_db_dags,
clear_db_import_errors
from tests_common.test_utils.format_datetime import
from_datetime_to_zulu_without_ms
@@ -322,7 +323,8 @@ class TestGetImportErrors:
expected_total_entries,
expected_filenames,
):
- response = test_client.get("/importErrors", params=query_params)
+ with assert_queries_count(2):
+ response = test_client.get("/importErrors", params=query_params)
assert response.status_code == expected_status_code
if expected_status_code != 200:
@@ -372,7 +374,8 @@ class TestGetImportErrors:
mock_get_auth_manager, batch_is_authorized_dag_return_value
)
# Act
- response = test_client.get("/importErrors")
+ with assert_queries_count(3):
+ response = test_client.get("/importErrors")
# Assert
mock_get_authorized_dag_ids.assert_called_once_with(method="GET",
user=mock.ANY)
assert response.status_code == 200