如果其他任务失败,Python 完美跳过任务
我的工作流程中有两个任务 A 和 B,如果任务失败,我想跳过 B,请问有什么办法吗? @任务 一个(): 经过 乙(): 经过 Flow("") 作为流程:
I have two tasks A and B in my workflow and I want to skip B if task failed,any idea please?
@task
A():
Pass
B():
Pass
Flow("") as flow:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果上游任务A失败,Perfect的默认行为不是运行任务B。但是,这些任务必须通过
upstream_tasks
关键字明确地依赖对方,或者通过彼此之间的数据隐式。您还可以使用触发者控制这种行为。如何设置依赖项的示例:
Prefect's default behavior is not to run task B if upstream task A fails. But those tasks must depend on each other either explicitly via the
upstream_tasks
keyword or implicitly by passing data between each other. You can also use triggers to control this behavior.Example of how you can set dependencies: