我必须运行星火作业,在这个星火作业中,我们必须传递日期作为参数来读取当前目录。我在用气流来安排工作。下面是一些信息
start_date
import pendulum
local_tz = pendulum.timezone("Asia/Kolkata")
start_date': datetime(year=2020, month=8, day=3,tzinfo=local_tz)schedule_interval
schedule_interval='20 0 * * *'要传递的值
{{ (execution_date + macros.timedelta(hours=5,minutes=30) - macros.timedelta(days=1)).strftime("%Y/%m/%d") }}我们必须在前一天午夜完成这项工作,但是这个表达式给了我前天的约会。我增加了5:30,因为我们的气流使用UTC的时间。
有谁能引用这里发生的事来解释一下吗?
谢谢
发布于 2020-08-18 13:19:32
下面是执行日期的定义。
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您不需要macros.timedelta(days=1)).strftime("%Y/%m/%d")在您的价值
https://stackoverflow.com/questions/63469143
复制相似问题