https://prefect.io logo
Title
m

Matt Alhonte

06/17/2022, 10:27 PM
Is there an easy way to set/change the Name/Slug of a Task based on the arguments? (ie, a task for running Jupyter notebooks that names the task after the filename of the notebook)
k

Kevin Kho

06/17/2022, 10:28 PM
I think you want this
m

Matt Alhonte

06/17/2022, 10:29 PM
sweet, thanks!
@Kevin Kho Does that work if you need to transform the argument in some way? Like let's say it gets passed a dictionary and I wanna access one particular element of the dictionary for the Task's name?
k

Kevin Kho

06/17/2022, 10:32 PM
You can use a function also, I think it’s in this doc
m

Matt Alhonte

06/17/2022, 10:32 PM
Aha! Thanks
Is there a way to do that with the Slug? (that's the thing that determines what shows up in the GUI, right?)
k

Kevin Kho

06/18/2022, 3:04 AM
I don’t think there is a way for the slug
j

Jacqueline Riley Garrahan

07/11/2022, 8:29 PM
Somewhat related to this question, is there a way to query the flow run using task_run_name?
k

Kevin Kho

07/11/2022, 8:31 PM
More like query for task_run_name and then return the flow_run accompanying it