Deceivious
04/24/2023, 7:58 AMMarvin
04/24/2023, 7:59 AMtags
parameter when creating the Flow
object for the subflow. Here's an example:
python
from prefect import Flow, task
@task
def my_task():
return "Hello, subflow!"
with Flow(name="my_subflow", tags=["subflow_tag"]) as subflow:
result = my_task()
# Use the subflow in another flow or however you'd like
In this example, the subflow is tagged with "subflow_tag". You can add multiple tags by providing a list of strings.
For more information on subflows in Prefect, you can refer to the Prefect documentation on Flows.Deceivious
04/24/2023, 8:00 AMMarvin
04/24/2023, 8:00 AMNate
04/25/2023, 4:54 PMIn [1]: from prefect import flow, tags
In [2]: @flow
...: def bar():
...: pass
...:
In [3]: @flow
...: def foo():
...: with tags("test"):
...: bar()
...:
Deceivious
04/25/2023, 4:58 PMNate
04/25/2023, 4:59 PMDeceivious
04/25/2023, 4:59 PMNate
04/25/2023, 5:13 PMtags
are a thing that are directly set-able on the flow run via the subflow objectDeceivious
04/25/2023, 5:21 PMNate
04/25/2023, 5:22 PMDeceivious
04/25/2023, 5:22 PM