You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Airflow doesn't show an error when there are DAGs with the same ID #29321
Create two files with DAGs
Both DAGs must have the same ID
Airflow will constantly update DAG structure/code resulting in dozens of weird behaviors and errors:
wrong DAG visualization
wrong DAG code
errors about missing tasks from time to time
What you think should happen instead
Airflow should show an error to the user and disable both DAGs.
As I understand it, as part of DAG processing, when the scheduler sees new a definition for an existing DAG, it overwrites regardless of the path. While this is by design, my team's stakeholders face this quite a bit where user's have duplicate files, with slightly different versions of a DAG. It's not obvious, and if you rely on a GCS or S3 DAG bucket that is abstracted from users/developers, it can be hard to diagnose.
One solution could be:
If the DAG processor sees an existing DAG defined in a file under a different path, we re-process the file under the old path, and see if the DAG is still defined there. If the DAG is still defined under the old path, we add an import error.
Activity
boring-cyborg commentedon Feb 2, 2023
Thanks for opening your first issue here! Be sure to follow the issue template!
michaelmicheal commentedon Feb 6, 2023
As I understand it, as part of DAG processing, when the scheduler sees new a definition for an existing DAG, it overwrites regardless of the path. While this is by design, my team's stakeholders face this quite a bit where user's have duplicate files, with slightly different versions of a DAG. It's not obvious, and if you rely on a GCS or S3 DAG bucket that is abstracted from users/developers, it can be hard to diagnose.
One solution could be:
If the DAG processor sees an existing DAG defined in a file under a different path, we re-process the file under the old path, and see if the DAG is still defined there. If the DAG is still defined under the old path, we add an import error.
Feel free to assign this to me.
eladkal commentedon Feb 6, 2023
@michaelmicheal see #19525 (comment) for more information
Closing as duplicate of #17861 @michaelmicheal if you'd like to work on it please comment on that issue so we can assign you