Hi. Is it possible in Prefect 2 to name the task b...
# ask-community
v
Hi. Is it possible in Prefect 2 to name the task based on input parameters? https://docs-v1.prefect.io/core/idioms/task-run-names.html
1
b
Hi Vadym, here is an article that may be helpful for your use case
You can rename a task using
with_options
and pass in the parameters you would like displayed in the name
v
Thanks, let me try
It worked! Thanks again.
🚀 2
2
k
@terrence I saw several people asked about this.
with_options
is only available in API. I wonder if we can add this under Concepts/Tasks? I can work on adding it
👍 1
1
t
Yep I’ll look into getting this incorporated.
gratitude thank you 2
k
Let me know if I can help in anyway
l
Is it possible to make this work with
task.map
?
Copy code
@task
def say_hello(name: str) -> None:
    print(name)
This works
Copy code
names = ["a", "b"]
for name in names:
    say_hello.with_options(name=f"say {name}"}
Is it possible to make it work with
Copy code
names = ["a", "b"]
say_hello.map(names)
Bumping this up
z
We don’t support changing options on mapped tasks yet, we’re thinking about a nice way to expose this though.