This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-0-test by this push:
new 38225c6a7e8 [v3-0-test] Fix reading number of dags from direct system
providers path (#50843) (#50877)
38225c6a7e8 is described below
commit 38225c6a7e807e0bc7d36ab8f64933c6d6d2cf9a
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed May 21 14:40:04 2025 +0200
[v3-0-test] Fix reading number of dags from direct system providers path
(#50843) (#50877)
The original PR #49978 that fixed generation of proper documentation for
standard provider examples added retrieval of the path by checking
import location for the standard provider. Instead we are now using
direct path to the provider.
(cherry picked from commit 13c6020278d1b4eddfcc10b4544ec2bed451a7d5)
Co-authored-by: Jarek Potiuk <[email protected]>
---
.../unit/api_fastapi/core_api/routes/public/test_dag_report.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git
a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_report.py
b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_report.py
index d1204bedd3e..314d6126b96 100644
---
a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_report.py
+++
b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_report.py
@@ -23,7 +23,7 @@ import pytest
from airflow.utils.file import list_py_file_paths
-import system.standard
+from tests_common.pytest_plugin import AIRFLOW_ROOT_PATH
from tests_common.test_utils.config import conf_vars
from tests_common.test_utils.db import clear_db_dags, parse_and_sync_to_db
@@ -34,6 +34,10 @@ TEST_DAG_FOLDER_WITH_SUBDIR = f"{TEST_DAG_FOLDER}/subdir2"
TEST_DAG_FOLDER_INVALID = "/invalid/path"
TEST_DAG_FOLDER_INVALID_2 = "/root/airflow/tests/dags/"
+STANDARD_PROVIDER_SYSTEM_TESTS_PATH = (
+ AIRFLOW_ROOT_PATH / "providers" / "standard" / "tests" / "system" /
"standard"
+)
+
def get_corresponding_dag_file_count(dir: str, include_examples: bool = True)
-> int:
from airflow import example_dags
@@ -41,7 +45,7 @@ def get_corresponding_dag_file_count(dir: str,
include_examples: bool = True) ->
return (
len(list_py_file_paths(directory=dir))
+ (len(list_py_file_paths(next(iter(example_dags.__path__)))) if
include_examples else 0)
- + (len(list_py_file_paths(next(iter(system.standard.__path__)))) if
include_examples else 0)
+ +
(len(list_py_file_paths(STANDARD_PROVIDER_SYSTEM_TESTS_PATH.as_posix())) if
include_examples else 0)
)