Hi all. I am using the functional API, and when us...
# prefect-community
n
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
@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
@itay livni this was exactly what I was looking for, missed it on the docs. Thanks!
👍 2
j
Hey @itay livni Sorry maybe I’m being dense, I used the following:
Copy code
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
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
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