在 Apache Airflow 中,您可以依赖于任务的前一个 运行 吗?
In Apache Airflow, can you have a dependency on a previous run of a task?
假设 A_T
表示今天的任务 A,A_T-1
表示昨天的任务 A。是否可以将 A_T-1
指定为运算符,以便我可以拥有这样的依赖关系图:
A_T >> B_T
A_T-1 >> B_T
查看有关 Cross-DAG Dependencies 的官方文档。这是一个值得遵循的好习惯:
When two DAGs have dependency relationships, it is worth considering combining them into a single DAG, which is usually simpler to understand. Airflow also offers better visual representation of dependencies for tasks on the same DAG. However, it is sometimes not practical to put all related tasks on the same DAG.
下面是一个不同的例子(来自上面的文档):
A task may depend on another task on the same DAG, but for a different execution_date
.
我认为这可能是你的情况,所以如果你仍然需要它,你可以使用 ExternalTaskSensor
with the argument execution_delta
. Check here 获取有关该传感器参数的所有详细信息。
假设 A_T
表示今天的任务 A,A_T-1
表示昨天的任务 A。是否可以将 A_T-1
指定为运算符,以便我可以拥有这样的依赖关系图:
A_T >> B_T
A_T-1 >> B_T
查看有关 Cross-DAG Dependencies 的官方文档。这是一个值得遵循的好习惯:
When two DAGs have dependency relationships, it is worth considering combining them into a single DAG, which is usually simpler to understand. Airflow also offers better visual representation of dependencies for tasks on the same DAG. However, it is sometimes not practical to put all related tasks on the same DAG.
下面是一个不同的例子(来自上面的文档):
A task may depend on another task on the same DAG, but for a different
execution_date
.
我认为这可能是你的情况,所以如果你仍然需要它,你可以使用 ExternalTaskSensor
with the argument execution_delta
. Check here 获取有关该传感器参数的所有详细信息。