Itay Livni
Itay Livni

Reputation: 2188

How to assign a name to a control_flow in prefect?

How do you assign a name to a merge task in a flow?

thing_three = merge(thing_one, thing_two)

The ultimate goal is to retrieve merge using flow.get_tasks(name="thing_merger")

Thanks in advance.

Upvotes: 5

Views: 162

Answers (1)

nicholas
nicholas

Reputation: 221

The most straightforward way to handle this would be to use:

thing_three = merge(thing_one, thing_two)

thing_three.name = "thing_merger"

Then when you call flow.get_tasks(name="thing_merger"), it'll return:

[<Task: thing_merger>]

Upvotes: 5

Related Questions