Is there a way to configure different 'retries' for tasks in the same DAG

前端 未结 2 992
一向
一向 2021-01-07 11:14

I have a DAG with many sub-tasks in it. In the middle of the DAG, there is a validation task and based on the result/return code from the task, i want to take two different

2条回答
  •  半阙折子戏
    2021-01-07 11:54

    Regarding your first problem, you set task/Operator specific retry options quite easily. Reference: baseoperator.py#L77.

    Problem two, you can branch within a DAG easily with BranchPythonOperator (Example Usage: example_branch_operator.py). You will want to nest your validation task/logic within the BranchPythonOperator (You can define and execute operators within operators).

提交回复
热议问题