This is an automated email from the ASF dual-hosted git repository.
vatsrahul1001 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 bd680179a82 [v3-3-test] Stop dag processor from warning on every file
path normalized for stats (#71091) (#71764)
bd680179a82 is described below
commit bd680179a82e46709d05e60fa8dc608a243227da
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Aug 19 17:47:15 2026 +0530
[v3-3-test] Stop dag processor from warning on every file path normalized
for stats (#71091) (#71764)
* Stop dag processor from warning on every file path normalized for stats
* Apply suggestions from code review
---------
(cherry picked from commit 84454220b3c25bc4b2ef1be71e73d0cece380868)
Co-authored-by: bujjibabukatta <[email protected]>
Co-authored-by: Ephraim Anierobi <[email protected]>
---
airflow-core/src/airflow/dag_processing/manager.py | 2 +-
airflow-core/tests/unit/dag_processing/test_manager.py | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/airflow-core/src/airflow/dag_processing/manager.py
b/airflow-core/src/airflow/dag_processing/manager.py
index b214c0029e7..ba197df0255 100644
--- a/airflow-core/src/airflow/dag_processing/manager.py
+++ b/airflow-core/src/airflow/dag_processing/manager.py
@@ -155,7 +155,7 @@ class DagFileInfo:
@property
def normalized_file_path_for_stats(self) -> str:
"""Return the relative file path normalized for use in stats tags."""
- return normalize_name_for_stats(str(self.rel_path))
+ return normalize_name_for_stats(str(self.rel_path), log_warning=False)
def _config_int_factory(section: str, key: str):
diff --git a/airflow-core/tests/unit/dag_processing/test_manager.py
b/airflow-core/tests/unit/dag_processing/test_manager.py
index 15dc8975e85..c5e09de0563 100644
--- a/airflow-core/tests/unit/dag_processing/test_manager.py
+++ b/airflow-core/tests/unit/dag_processing/test_manager.py
@@ -3722,3 +3722,20 @@ class TestMultiTeamMetrics:
# Two bundles resolved in a single batched query; the repeat call is
served from cache.
mock_get_team_names.assert_called_once()
assert manager._bundle_name_to_team_name == {"bundle_a": "team_alpha",
"bundle_b": "team_alpha"}
+
+
+def test_normalized_file_path_for_stats_does_not_warn(caplog):
+ """
+ rel_path always contains "/" for any nested DAG file, so normalizing it
for stats
+ always requires substitution -- this must not log a warning on every DAG
file, every
+ processing cycle.
+ """
+ dag_file_info = DagFileInfo(
+ bundle_name="testing", bundle_path=TEST_DAGS_FOLDER,
rel_path=Path("dags/test/test_dag.py")
+ )
+
+ with caplog.at_level(logging.WARNING,
logger="airflow._shared.observability.metrics.stats"):
+ result = dag_file_info.normalized_file_path_for_stats
+
+ assert result == "dags_test_test_dag.py"
+ assert caplog.entries == []