Hello guys, I'm trying to migrate from prefect 1 to 2, but I can't find how to put dynamic names on tasks, it would be the equivalent of this, in prefect 1 https://docs-v1.prefect.io/core/concepts/templating.html. Can anybody help me ?
✅ 1
m
Mason Menges
11/16/2022, 10:02 PM
Hey @dados grupoa I believe you should be able to accomplish this by running the task with options something like this
Copy code
from prefect import task, flow
@task
def taska():
print("do something")
@flow
def flowa():
taska.with_options(name="Some_custom_name")()
if __name__ == "__main__":
flowa()
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.