首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >气流execution_date值

气流execution_date值
EN

Stack Overflow用户
提问于 2020-08-18 12:57:10
回答 1查看 2.3K关注 0票数 0

我必须运行星火作业,在这个星火作业中,我们必须传递日期作为参数来读取当前目录。我在用气流来安排工作。下面是一些信息

start_date

代码语言:javascript
复制
import pendulum
local_tz = pendulum.timezone("Asia/Kolkata")
start_date': datetime(year=2020, month=8, day=3,tzinfo=local_tz)

schedule_interval

代码语言:javascript
复制
schedule_interval='20 0 * * *'

要传递的值

代码语言:javascript
复制
{{ (execution_date + macros.timedelta(hours=5,minutes=30) - macros.timedelta(days=1)).strftime("%Y/%m/%d") }}

我们必须在前一天午夜完成这项工作,但是这个表达式给了我前天的约会。我增加了5:30,因为我们的气流使用UTC的时间。

有谁能引用这里发生的事来解释一下吗?

谢谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-08-18 13:19:32

下面是执行日期的定义。

代码语言:javascript
复制
The execution time in Airflow is not the actual run time, but rather the start timestamp of its schedule period. For example, the execution time of the first DAG run is 2019–12–05 7:00:00, though it is executed on 2019–12–06.Dec 9, 2019

取自https://towardsdatascience.com/apache-airflow-tips-and-best-practices-ff64ce92ef8#:~:text=The%20execution%20time%20in%20Airflow,on%202019%E2%80%9312%E2%80%9306

您不需要macros.timedelta(days=1)).strftime("%Y/%m/%d")在您的价值

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63469143

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档