Conditional branching and fan-in for Ops whose upstream gives out dynamic outputs #23348
Unanswered
spandan-sharma
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This current bug in
dagster
is discussed in this thread: #7060 (comment).Of-course it would be awesome if that was fixed as it's very limiting in what we can do with graph composability just now, but in the meantime I'm all ears to alternate solutions should anyone have any.
Briefly: Op
op0
gives out dynamic output. The downstreamop1
does conditional branching usingOut
andOutput
with say 2 branchesyes
andno
(this part is pretty standard). Theyes
branch feeds into downstreamop2_yes
and theno
branch toop2_no
. Thenop3
does a fan-in ofop2_yes
andop2_no
. Thenop4
is the final downstream which depends onop3
and that's it.Since
op0
gives out dynamic output, AFAIK i can only use themap
andcollect
functions, but how do I introduce the conditional branching along the way? Because I couldn't figure that out, I separatedop1
,op2_yes
,op2_no
andop3
into another graphg1
and keptop0
andop4
in the main graphg0
. Then simply hook it up like this:Now
g1
can do whatever conditional branchings and fan-ins it wants internally, except it errors out due to the mentioned bug.Is there anyway to not introduce
g1
(until the bug is fixed) and do everything ing0
assuming it helps avoid that bug? Is there any other alternative?Beta Was this translation helpful? Give feedback.
All reactions