Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Airflow will keep showing example dags even after removing it from configuration

Airflow example dags remain in the UI even after I have turned off load_examples = False in config file.

enter image description here

The system informs the dags are not present in the dag folder but they remain in UI because the scheduler has marked it as active in the metadata database.

I know one way to remove them from there would be to directly delete these rows in the database but off course this is not ideal.How should I proceed to remove these dags from UI?

like image 718
fernandosjp Avatar asked Jun 28 '17 14:06

fernandosjp


2 Answers

There is currently no way of stopping a deleted DAG from being displayed on the UI except manually deleting the corresponding rows in the DB. The only other way is to restart the server after an initdb.

like image 104
Him Avatar answered Sep 28 '22 01:09

Him


Airflow 1.10+:

  • Edit airflow.cfg and set load_examples = False
  • For each example dag run the command airflow delete_dag example_dag_to_delete

This avoids resetting the entire airflow db.

(Since Airflow 1.10 there is the command to delete dag from database, see this answer )

like image 35
Ena Avatar answered Sep 28 '22 02:09

Ena