简体   繁体   English

气流 - 如何获取当前 dag_run 的开始日期(不是特定任务)?

[英]airflow - how to get start date of current dag_run (not specific task)?

Tasks 1, 2, 3, 4 in the same dag will insert to a db table.同一 dag 中的任务 1、2、3、4 将插入到 db 表中。 I then want task 7 to update the db table only for rows with timestamp >= the time of the start of the dagrun (not the start time of task 7).然后,我希望任务 7 仅针对时间戳 >= dagrun 开始时间(不是任务 7 的开始时间)的行更新 db 表。

Is there some jinja/kwarg/context macro i can use?我可以使用一些 jinja/kwarg/context 宏吗? I didn't see any example to get dagrun start_date (not exec date).我没有看到任何获取 dagrun start_date 的示例(不是执行日期)。

context变量包含许多包含任务上下文信息的变量,包括dag_run.start_date

context['dag_run'].start_date

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM