气流depends_on_past说明 [英] Airflow depends_on_past explanation

查看:351
本文介绍了气流depends_on_past说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据官方气流文档
任务上游的任务实例必须处于成功状态。另外,如果您设置了depends_on_past = True,则前一个任务实例需要成功(除非是该任务的第一次运行)。

According to the official Airflow docs, The task instances directly upstream from the task need to be in a success state. Also, if you have set depends_on_past=True, the previous task instance needs to have succeeded (except if it is the first run for that task).

众所周知,任务是实例化和

As all know, the task is kind of 'instantiated & parameteriazed' operator.

现在这让我感到困惑。例如:

Now this is what confuse me. For example:

DAG: {op_1} -> {op_2} -> {op_3}

{op_2}是一个简单的PythonOperator,它从{op_1}中获取1个参数并执行操作;

{op_2} is a simple PythonOperator that takes 1 parameter from {op_1} and do stuff;

据我所知,op_2(param_1)& op_2(param_2)被视为2个不同的任务。

To my understanding, op_2(param_1) & op_2(param_2) are considered as 2 different tasks.

depends_on_past 设置为True,然后:

Given depends_on_past is set to True, then:


  1. 如果op_2(param_1)仍在运行;可以运行op_2(param_2)吗?

  2. 如果op_2(param_1)在上一次运行中失败;可以在当前运行中运行op_2(param_1)吗?


推荐答案

从官方文档:

depends_on_past (布尔值)设置为True时,如果先前的任务计划未成功,则不会触发任务。

depends_on_past (boolean) when set to True, keeps a task from getting triggered if the previous schedule for the task hasn’t succeeded.

因此,除非先前运行的DAG运行失败,否则 depends_on_past 不应是一个因素,如果先前运行了DAG,则根本不会影响当前运行运行成功执行任务。

So unless a previous run of your DAG has failed, the depends_on_past should not be a factor, it will not affect the current run at all if the previous run executed the tasks successfully.

这篇关于气流depends_on_past说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆