Jai P
04/26/2022, 5:39 PMcase
statement in prefect 2.0: is there a rough timeline for when that may be introduced? Also, are there any major differences that are planned between how they work in prefect 1.0, where i think you can only conditionally go between tasks (to, say, possibly supporting subflows)?Anna Geller
Kevin Kho
if
inside a flow now.
@flow
def myflow():
a = task_one()
if a.result() == ...
....
Jai P
04/26/2022, 5:44 PMcase
was coming, and i wasn't sure in what case i'd use that over just native if
Kevin Kho
case
because if
is more flexible. The previous case
only tested for equality. Not greater than or less than so you needed an intermediate task to achieve that.Jai P
04/26/2022, 8:04 PMif
statements more, but im curious if that has the same implication that it did in prefect 1.0 (meaning tasks/subflows not run due to an if
are marked as Skipped
)Kevin Kho
Jai P
04/26/2022, 9:49 PM.result()
, does that possibly introduce some weirdness in execution/dependencies?@flow
def my_flow():
a = task_one()
if a.result():
task_two()
else:
task_three()
i won't necessarily see that task_one
was `wait_for`d on task_two
or task_three
Kevin Kho
wait_for
in task_two
and task_three
but they will wait for a
by default.
.result()
is actually .wait().result()
implicitlyJai P
04/26/2022, 9:54 PMorion
wouldn't necessarily reflect the waitingwait_for
. if you don't care about that particular thing...then it is fine because it implicitly happens anywaysKevin Kho
Jai P
04/26/2022, 10:03 PMKevin Kho