https://prefect.io logo
Title
l

Leonardus Chen

01/31/2023, 5:38 PM
Hi everyone, it possible to use a task parameter as task name using
task.map
? I know the following works
@task
def say_hello(name: str) -> None:
    print(name)

names = ["a", "b"]
for name in names:
    say_hello.with_options(name=f"say {name}"}
But how do I make it work with mapping?
names = ["a", "b"]
say_hello.map(names)
I've asked the question a few days ago in an old thread (https://prefect-community.slack.com/archives/CL09KU1K7/p1674788888354029?thread_ts=1668092490.489519&cid=CL09KU1K7), asking it again here to get more attention
👀 2
h

Hans Lellelid

01/31/2023, 8:13 PM
I've also wondered this; we have a
process_datasource(ds_name, other_params)
that we map over a calculated list of applicable datasources (less than 12); it would be wonderful to have the task names include this value from an observability perspective.