Airflow: Why is there a start_date for operators?

前端 未结 4 1880
北海茫月
北海茫月 2021-01-04 23:24

I don\'t understand why do we need a \'start_date\' for the operators(task instances). Shouldn\'t the one that we pass to the DAG suffice?

Also, if the current time

4条回答
  •  梦毁少年i
    2021-01-05 00:27

    Some complex requirements may need specific timings at the task level. For example, I may want my DAG to run each day for a full week before some aggregation logging task starts running, so to achieve this I could set different start dates at the task level.

    A bit more useful info... looking through the airflow DAG class source it appears that setting the start_date at the DAG level simply means it is passed through to the task when no default value for task start_date was passed in to the DAG via the default_args dict, or when no specific start_date is are defined on a per task level. So for any case where you want all tasks in a DAG to kick off at the same time (dependencies aside), setting start_date at the DAG level is sufficient.

提交回复
热议问题