Airflow Dag 不会自动 运行

Airflow Dag isn't run automatically

我尝试 运行 开始日期为 2018-11-1 的任务。

我是这样配置的,不知道什么时候打开气流,为什么什么都没有运行。我对此很陌生。你能告诉我我做错了什么吗?

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)`

2021 年不会 运行 因为你的 start/end 日期是 2018 年 11 月并且 catchup=False

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

表示 运行 dag 仅在这些日期之间。然后 catchup=False 表示不回填今天之前的任何历史计划。

如果你想 运行 今天,你需要启用 catchup 为 True。