You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "bujjibabukatta (via GitHub)" <gi...@apache.org> on 2026/08/04 12:28:16 UTC
[PR] Stop dag processor from warning on every file path normalized for stats [airflow]
bujjibabukatta opened a new pull request, #71091:
URL: https://github.com/apache/airflow/pull/71091
**Summary**
Right after the dag-processor starts, it repeatedly logs a warning like:
"Name 'dags/test/test_dag.py' contains invalid characters for stats
reporting. Reporting stats with normalized name 'dags_test_test_dag.py'."
This fires once per DAG file, on every processing cycle.
**Root cause**
DagFileInfo.normalized_file_path_for_stats calls normalize_name_for_stats()
without log_warning=False. A relative file path always contains "/" as a
directory separator, so normalization always requires substitution -- the
warning can never signal an actual problem, only expected, routine behavior.
**Fix**
Pass log_warning=False for this specific call. The other normalize_name_for_stats
call sites in the same file (bundle_name, file name stem) are left unchanged,
since those genuinely rarely contain invalid characters, so a warning there
still carries real diagnostic value.
**Testing**
Added a regression test asserting normalized_file_path_for_stats does not
emit a warning for a normal nested file path.
closes: #71084
Was generative AI tooling used ?
- [X] Yes - Claude
Generated-by: Claude following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Stop dag processor from warning on every file path normalized for stats [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on code in PR #71091:
URL: https://github.com/apache/airflow/pull/71091#discussion_r3802848710
##########
airflow-core/tests/unit/dag_processing/test_manager.py:
##########
@@ -3620,3 +3620,20 @@ def test_get_team_names_batches_and_caches(self, mock_get_team_names):
# 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.records == []
Review Comment:
```suggestion
assert caplog.entries == []
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Stop dag processor from warning on every file path normalized for stats [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy merged PR #71091:
URL: https://github.com/apache/airflow/pull/71091
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Stop dag processor from warning on every file path normalized for stats [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #71091:
URL: https://github.com/apache/airflow/pull/71091#issuecomment-5327125493
### Backport successfully created: v3-3-test
Note: As of [Merging PRs targeted for Airflow 3.X](https://github.com/apache/airflow/blob/main/dev/README_AIRFLOW3_DEV.md#merging-prs-targeted-for-airflow-3x)
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.
In matter of doubt please ask in [#release-management](https://apache-airflow.slack.com/archives/C03G9H97MM2) Slack channel.
<table>
<tr>
<th>Status</th>
<th>Branch</th>
<th>Result</th>
</tr>
<tr>
<td>✅</td>
<td>v3-3-test</td>
<td><a href="https://github.com/apache/airflow/pull/71764"><img src="https://img.shields.io/badge/PR-71764-blue" alt="PR Link"></a></td>
</tr>
</table>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org