https://prefect.io logo
h

Hugo Polloli

03/14/2022, 1:39 PM
Hi, I have chained tasks that are simply database operations, they don't return anything but they have to be run in a specific order. To this day I've simply used a boolean, I
return True
and pass it, unused, to the next task. Is that ok or did I miss a way to do that more "beautifully" in the docs ? (I don't find it particularly bad, + with the fact that I suffix it with "_done" I think it's explicit, but was still wondering)
Copy code
t1_done = task1()
t2_done = task2(t1_done)
....
s

Sylvain Hazard

03/14/2022, 1:44 PM
Hey ! The recent 1.1.0 release might have what you're looking for : the `.pipe` operator. It makes this kind of use case a bit more readable from a developer perspective.
upvote 4
t

Tomer Cagan

03/14/2022, 2:09 PM
You can specify upstream tasks. Look here https://docs.prefect.io/core/advanced_tutorials/task-guide.html under "_You can specify non-data dependencies with the functional API_"
upvote 4
h

Hugo Polloli

03/14/2022, 4:33 PM
Thanks to you both ! Looks like I was right to ask for a more beautiful way of doing, I'll see which one of these best applies to my case Thanks again
😍 3
4 Views