-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Description
Apache Airflow version: 1.10.12
What happened:
When I rename the dag_id, the new dag_id shows up in the UI but the old dag_id does not disappear and remains in the UI.
What you expected to happen:
When Airflow lists out the python files and tries to deactivate the deleted dags during dag processing, the old DAG's file location is still in the list of the alive DAG location because the new DAG is now defined in the old DAG's python file. Even when you manually set is_active to False in the metastore, the dag processing process will set it back to True.
This happens whether or not DAG serialization is enabled.
How to reproduce it:
I was able to reproduce it by following these steps:
- Add a python file in the dags folder and initialize the DAG
- Verify the dag shows up in the UI
- Change the dag_id in the same file to something else
- Verify the new dag shows up in the UI
- Both the old DAG and the new DAG are visible on the UI as well as the metadata db.
➜ dags pwd
/Users/alan/projects/astro/dags
➜ dags ls
wow.py
from datetime import datetime
from airflow.models import DAG
dag = DAG(
dag_id='yay',
schedule_interval='@once',
start_date=datetime(2020, 1, 1),
catchup=False
)In the screenshot, both DAGs are marked as active but there only one DAG defined in wow.py.

Anything else we need to know: