Hey team - I have a prefect 1 flow in which one of...
# ask-community
m
Hey team - I have a prefect 1 flow in which one of the tasks is being called twice even though I only have one invocation of it. I will post a mock snippet in the thread.
Copy code
df_inc = inception(accounts) #inception is a task

UploadSQLTask(task_args={'trigger': all_successful},
              df=df_inc,
              unlinkFile=False,
              upstream_tasks=[inception]
              )
Is there any reason this is running the inception task twice when I only want to run once?
z
Looks like you want
upstream_tasks
to be
df_inc
m
df_inc is just the return value, not the task. I will try it out!
z
The return value is representative of the task while you are constructing a flow
You don’t actually need
upstream_tasks
at all here since you are passing
df_inc
as data
m
Got it. I'll try it out and see if it works as expected
Thanks for the help @Zanie
d
But i don't think that the upstream tasks keyword Param has anything to do with the duplication on this case?
z
Does it not? It seems likely that passing a
Task
object there is adding a second instance of that task to the graph.
i.e. we construct a graph of tasks by looking at the declaration of your flow. If you pass
inception
via
df_inc
as well as
inception
via
upstream_task
we’re going to have to copies of that task in the graph.
d
HUmm ill check it out thanks 😄