Tony Yun
11/06/2023, 3:16 PMtask_run_name
if the task is running multiple times? https://docs.prefect.io/2.14.3/concepts/tasks/
@task(name="My Example Task",
description="An example task for a tutorial.",
task_run_name="hello-{name}-on-{date:%A}")
def my_task(name, date):
pass
Nate
11/06/2023, 5:30 PMtask_run_name
that retrieves the dynamic_key
from the task run context, which could look like
from prefect import flow, task
from prefect.context import get_run_context
def incremental_name():
return f"Run {get_run_context().task_run.dynamic_key}" # modify as needed
@task(task_run_name=incremental_name)
def foo():
pass
@flow
def someflow():
foo()
foo()
foo()
someflow()
which givesTony Yun
11/06/2023, 5:31 PM