I’m getting the error: airflow.exceptions.DagNotFound: Dag id test_task not found in DagModel when trying to run a dag via airflow trigger_dag test_dag.
DAG is listed correctly when running airflow list_dags. I have also checked to make sure the $AIRFLOW_HOME directory is correctly set to where the dag is. Only way I can get it to work is by running a specific task such as airflow test test_dag test_task. Running python dags/test_dag.py shows no errors.
Code in the dag file itself, after imports:
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2015, 6, 1),
'email': ['[email protected]'],
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=5),
}
dag = DAG(
dag_id='test_dag'
default_args=default_args,
schedule_interval=timedelta(days=1)
)
You need to use the dag_id parameter:
dag = DAG(
dag_id='test_dag',
default_args=default_args,
schedule_interval=timedelta(days=1)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With