Konstantin
02/04/2022, 1:26 PMAnna Geller
Konstantin
02/04/2022, 1:31 PM@task(task_run_name="{description}", log_stdout=True)
def transform_data(values):
...
ukey = [val for val in values.keys()][0]
description = "blablabla {key} text text".format(key=ukey)
...
with Flow("flow_name", storage=core_storage) as flow:
...
result=transform_data.map(values):
Anna Geller
name
argument:
@task(name="some_task_name", task_run_name="{val}")
b) set it within your Flow block by using the task_args
argument:
with Flow("example") as flow:
result = some_task(task_args={"name": "new-task-name"})
What the documentation you sent describes is #2 task run names and this is something you can see in the UI once you register and run the flow with a backend (e.g. using Prefect Cloud)Konstantin
02/04/2022, 1:47 PMfrom prefect import task, Flow
@task
def get_values():
return ["value", "test", "demo"]
@task(task_run_name="{val}")
def compute(vals):
val = "new_task_name"
return vals
with Flow("task_run_names") as flow:
vals = get_values()
compute.map(vals)
Anna Geller
vals
rather than val
@task(task_run_name="{vals}")
def compute(vals):
Konstantin
02/04/2022, 2:21 PMAnna Geller
Kevin Kho
"{x}".format(x = "text")
.