Fix unnecessary DAG file stats warning - #71098
Closed
09Catho wants to merge 1 commit into
Closed
Conversation
Signed-off-by: 09Catho <ashketchume45@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR stops an expected, repeatedly-emitted stats-name warning when Dag file relative paths are normalized for metrics tags in the Dag processor. It keeps the normalized tag value while suppressing the invalid-character warning for this specific, intentionally-normalized path.
Changes:
- Disable warning emission when normalizing
DagFileInfo.rel_pathfor stats tags by passinglog_warning=False. - Add a regression test asserting the normalized stats tag value and that no warning is emitted.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
airflow-core/src/airflow/dag_processing/manager.py |
Suppresses normalization warning for Dag file path stats tag (log_warning=False) while preserving normalized output. |
airflow-core/tests/unit/dag_processing/test_manager.py |
Adds a regression test ensuring normalization happens and no warning is logged. |
Contributor
|
closed in #71091 which came first. Thanks for the work! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the repeated warning emitted when expected DAG relative paths are normalized for metrics tags.
The path is intentionally normalized, so
DagFileInfo.normalized_file_path_for_statsnow disables the invalid-character warning while preserving the normalized tag. A regression test covers both the normalized value and absence of a warning.closes: #71084
Testing:
python -m compileall -q airflow-core/src/airflow/dag_processing/manager.py airflow-core/tests/unit/dag_processing/test_manager.pygit diff --checkThe repository's
uv run pytest ...and Ruff commands could not reach collection on Windows becausepykerberos==1.2.4requires the unavailablegssapi/gssapi.hheader.Was generative AI tooling used to co-author this PR?
Generated-by: OpenAI Codex following the guidelines