https://prefect.io logo
g

Gary Levin

12/07/2020, 10:01 PM
https://docs.prefect.io/core/concepts/tasks.html#operators indicates that this happens, but not which operators are available. I am guessing that
+
is defined as something like this in the Flow Context:
lambda(x:Parameter, y:Parameter) Task("Add". lambda()(x.value + y.value))
Got it. Parameter.add is what returns the task named "Add". Should have realized that there is no magic. Just need to get a list of the operators covered.
Operations defined for parameters: add, and, floordiv, ge, getitem, gt, hash, le, lt, mod, mul, or, pow, rand, sub, truediv. Not sure how == is handled between Parameters.
Yeah, if x and y are Parameters, x == y does not compare the values. So don't use == in a condition of an ifelse.
k

Kyle Moon-Wright

12/07/2020, 10:37 PM
For that one, case statements come in handy.
3 Views