Airflow : dag run with execution_date = trigger_date = fixed_schedule

后端 未结 3 1042
情书的邮戳
情书的邮戳 2021-02-04 13:32

in airflow, I would like to run a dag each monday at 8am (the execution_date should be of course \"current day monday 8 am\"). The relevant parameters to set up for this workflo

3条回答
  •  清歌不尽
    2021-02-04 13:44

    For me I solved it in this way:

    {{ ds if dag_run.external_trigger or dag_run.is_backfill else macros.ds_add(ds, 1) }}
    

    If DAG was run by external trigger we shouldn't change ds. If DAG was run by backfilling we shouldn't change ds. If DAG was scheduled we use macros to increment it by one day.

提交回复
热议问题