Youshikyou
Youshikyou

Reputation: 417

Airflow Dag isn't run automatically

I try to run a task whose start date is 2018-11-1.

Here is how I configure it, but I don't know when I toggle on the airflow, why there is nothing run. I am very new to this. Would you please tell me what I did wrong?

enter image description here

default_args = {
    'owner': 'xxxx',
    'depends_on_past': False,
    'email_on_retry': False,
    'retries': 3,
    'retry_delay': timedelta(minutes=1),
    
}

dag = DAG('airflow_project',
          default_args=default_args,
          description='Load and transform data in Redshift with Airflow',
          start_date=datetime(2018, 11, 1, 0, 0, 0, 0),
          end_date=datetime(2018, 11, 3, 0, 0, 0, 0),
          schedule_interval="@daily",
          catchup=False,
        )

start_operator = DummyOperator(task_id='Begin_execution',dag=dag)`

Upvotes: 0

Views: 563

Answers (1)

Emma
Emma

Reputation: 9308

This won't run in 2021 because your start/end date is 2018 Nov and catchup=False.

start_date=datetime(2018, 11, 1, 0, 0, 0, 0),
end_date=datetime(2018, 11, 3, 0, 0, 0, 0),

means run the dag only between these dates. Then catchup=False means do not backfill any historical schedules prior to today.

If you want to run this today, you need to enable catchup to True.

Upvotes: 1

Related Questions