Title
d

Daniel Galea

01/30/2023, 3:45 PM
Is it possible to create a dependency graph like the following? In which you have an op that should always start first, and when it is finished it triggers two other downstream ops which are independent of each other but should always start after OP 1? The reason I ask is that OP 1 will generate a value that both independent Ops need, so I want to pass it on to them.
dagster bot responded by community 1
j

Jaap Langemeijer

01/30/2023, 3:56 PM
Copy code
``````@graph
def my_op():
res = op_1()
op_3(op_2(op_b(res))))
op_a(res)``````
🌈 1
d

Daniel Galea

01/30/2023, 3:57 PM
This creates a linear graph, not one that breaks off into two branches though, right?
j

Jaap Langemeijer

01/30/2023, 3:57 PM
sorry hit enter accidentally
👍 1
something like this should work
d

Daniel Galea

01/30/2023, 3:59 PM
Wouldn't this start op_a() and op_b() at the same time, and in the case of op_b() it would finish with op_1()?
j

Jaap Langemeijer

01/30/2023, 4:01 PM
haha I am truly screwing around, but the idea is that if you use the result from ops in a different op in the graph, dagster will understand that they are connected.
d

Daniel Galea

01/30/2023, 4:02 PM
I see! I'll try this out 🙂 I see something similar in the nesting-graphs documentation, I'll let you know if this works. Thanks 🙂
j

Jaap Langemeijer

01/30/2023, 4:02 PM
So make sure that the result from an op is used in a different op. There are also nothing dependencies: https://docs.dagster.io/concepts/ops-jobs-graphs/graphs#defining-nothing-dependencies if you just want them to finish after each other without returning anything
👍 1
d

Daniel Galea

01/30/2023, 4:03 PM
Yes I've used this a couple of times already 🙂 but in linear graphs so far
D 1
This works exactly as I want it to, thanks a lot! Saved me a lot of time 🙂 I was about to create my own dependency tree by using the GraphDefinition class
j

Jaap Langemeijer

01/30/2023, 4:06 PM
Np!