如何在 prefect 中为 control_flow 分配名称?

How to assign a name to a control_flow in prefect?

如何将 name 分配给流程中的 merge 任务?

thing_three = merge(thing_one, thing_two)

最终目标是使用flow.get_tasks(name="thing_merger")

检索merge

提前致谢。

处理此问题最直接的方法是使用:

thing_three = merge(thing_one, thing_two)

thing_three.name = "thing_merger"

然后当您调用 flow.get_tasks(name="thing_merger") 时,它会 return:

[<Task: thing_merger>]