Repository navigation
Warn in UI when the same dag_id is registered from multiple files - #68791
Merged
Merged
Conversation
takayoshi-makabe
requested review from
XD-DENG,
ashb,
ephraimbuddy and
jedcunningham
as code owners
June 21, 2026 04:42
takayoshi-makabe
requested review from
bbovenzi,
bugraoz93,
choo121600,
dheerajturaga,
guan404ming,
jason810496,
pierrejeambrun,
potiuk,
rawwar,
ryanahamilton,
shubhamraj-git and
vatsrahul1001
as code owners
June 21, 2026 04:58
Contributor
Author
|
The CI failure was in CI image checks / Static checks — the check-metrics-synced-with-registry hook requires every metric used in code to be registered in the metrics registry YAML, but dag_processing.duplicate_dag_id was missing. Fixed by adding the metric to |
Contributor
Author
|
Hi @potiuk, |
uranusjr
reviewed
Jul 1, 2026
uranusjr
reviewed
Jul 1, 2026
uranusjr
reviewed
Jul 1, 2026
Contributor
Author
|
@uranusjr |
uranusjr
reviewed
Jul 2, 2026
uranusjr
approved these changes
Jul 2, 2026
Contributor
Author
|
@uranusjr |
1 task done
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.
This is a follow-up to #68678, which proposed raising an ImportError when the same dag_id is found in two different files.
Currently, when two files define the same dag_id, Airflow silently overwrites the existing Dag entry with whichever file is parsed last — no error, no warning, no trace in the UI. This means a mis-deployed file can invisibly destroy a production Dag, leaving operators with no indication of what happened or where the conflict originated.
@uranusjr pointed out that an ImportError would fire transiently on every legitimate file rename, since the old DB entry persists until stale_dag_threshold passes. This PR avoids that entirely by recording a DagWarning instead of blocking the parse.
The warning shows both file names and the dag_id so users can self-diagnose:
For file moves the warning is transient and self-clearing; for real duplicates it persists until resolved.
Was generative AI tooling used to co-author this PR?