I have a task within a flow that returns a structu...
# ask-community
j
I have a task within a flow that returns a structure
val = my_task()
where val is some json thing. I also want to set that tasks downstream dependencies, though, which I had been doing with
val.set_downstream(othertask)
(although I was always a little confused as to why that would work). Well, now it's stopped working. What's the right way to do both of these things?
k
Hey @Jason Boorn, looks right to me
Copy code
with Flow(..) as flow:
    val = my_task()
    val2 = other_task()
    val.set_downstream(val2)
What behavior do you see and what does the schematic look like?
j
I get tributeError: 'dict' object has no attribute 'set_dependencies'
because it's taking val to be a dict rather than a task
k
That sounds like you didn’t wrap it in a task? Or did you call
.run()
? Could I see your code?
j
with Flow('short_checker', executor=LocalExecutor()) as flow:
results = []
result1 = mssql_short.task1()
results.append(result1)
result2 = mssql_short.task2()
results.append(result2)
result1.set_downstream(result2)
this was working
but now it isnt
task1 has a @task decorator on it
so does task2
thats a cut down version - I can show you the actual code but I cant send it over chat
oh wait
I think I may have found a task that doesnt have a decorator
lemme check this
ugh - sorry this was my bad (one of the internal tasks lacked a decorator)
k
No worries!
🙌 1