Is it possible to create a dependency graph like t...
# ask-community
d
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
Copy code
@graph
def my_op():
   res = op_1()
   op_3(op_2(op_b(res))))
   op_a(res)
🌈 1
d
This creates a linear graph, not one that breaks off into two branches though, right?
j
sorry hit enter accidentally
👍 1
something like this should work
d
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
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
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
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
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
Np!