When I create a DAG with air flow in python I can pass some parameters.
SETTINGS = {
'owner': 'hello',
'depends_on_past': False,
'start_date': datetime(2019, 1, 1),
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=5),
}
dag = DAG(dag_id,
schedule_interval='@daily',
catchup=False,
default_args=SETTINGS)
Yet when I do so, I still have to go on the interface and to enable the DAG with a click. I would like to know if there is a settings to pass to do it directly on creation. I think it has something to do with "pause" but can't find the name of the parameter.
Change dags_are_paused_at_creation
in airflow.cfg
to False
. The default value is True
, so your dags are paused at creation.
[core]
dags_are_paused_at_creation = False
Set the following environment variable.
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION=False
If you want to limit this setting for a single DAG you can set is_paused_upon_creation
DAG parameter to True
.
Example:
DAG(dag_id='my-dag', is_paused_upon_creation=True)
There is a parameter for a DAG: is_paused_upon_creation
. I haven't tried to use it, but you can find some information in the source code: https://github.com/apache/airflow/blob/master/airflow/models/dag.py
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