hi there, in prefect 1.0 we could dynamically assi...
# ask-community
n
hi there, in prefect 1.0 we could dynamically assign the task names with input params, something like:
Copy code
@task(name="extract(ctx.id)")
def extract(ctx):
These would then be displayed in the UI as
extract(4)
for example if our flow was running for ctx.id=4. I haven't been able to find anything like this for 2.0, am I just missing something?
1
m
Hey @Nick DeCraene you should be able to accomplish this by running a task with options. so something like this
Copy code
@flow(name="test")
async def test_flow(some_obj):

ta = await taskA.with_options(name=some_obj)(some_obj=some_obj)
n
awesome, thanks for the help!
m
No Problem 😄