https://prefect.io logo
Title
n

Nelson

09/07/2020, 9:33 AM
Hi all. I am using the functional API, and when using the same task multiple times, I cannot distinguish them in the schematic (example in the image, for
upload_dataframe...
for various tables). Opening the tasks also doesn’t provide info on their input to distinguish the different calls. Is there something I am missing that can help here?
i

itay livni

09/07/2020, 2:38 PM
@Nelson - Perhaps you can try renaming them i.e.
task_args={"name": "name-1"}
You can do this as a task configuration in two ways (1) Pass a name from inside the flow as shown above or (2) where the task is located
:upvote: 2
n

Nelson

09/08/2020, 7:55 AM
@itay livni this was exactly what I was looking for, missed it on the docs. Thanks!
👍 2
j

Jacob Blanco

09/24/2020, 4:54 AM
Hey @itay livni Sorry maybe I’m being dense, I used the following:
do_something_with_first_config = MyTask(common_parameter='common')

with Flow() as flow:
  result_a = do_something_with_first_config(name='First Config', my_param='a')
  result_b = do_something_with_first_config(name='Second Config', my_param='b')
Is that not the same as
task_args
?
n

Nelson

09/24/2020, 7:05 AM
If
do_something_with_first_config
is a task, you provide the
task_args
dict as an argument to
do_something_with_first_config
j

Jacob Blanco

09/24/2020, 7:48 AM
Thanks @Nelson tested it and it works. That’s awesome. It’s confusing that the name variable on the task doesn’t seem to do anything in this context.
👍 1