acoustic-carpenter-78188
02/06/2023, 7:14 AMget_primitive_val logic to fix condition validation when the Promise includes an integer 0, a boolean False or a float 0.0.
Slack conversation:
Hey all, I believe I found a small bug. LMK if there is a better channel for this. During local execution, conditionals interpret a int variable with value 0 as None.
@workflow
def _impl(
delta: int,
) -> Set[str]:
return (
conditional("terminal_case")
.if_((delta != -1) & (delta <= 10))
.then(end())
.else_()
.then(
iterate()
)
)
def cluster_distributed() -> Set[str]:
_impl(delta=0)
Outputs an error comparing NoneType <= 10Type ☑︎ Bug Fix ☐ Feature ☐ Plugin Are all requirements met? ☐ Code completed ☐ Smoke tested ☑︎ Unit tests added ☐ Code documentation added ☐ Any pending items have an associated Issue Complete description When the value is validated against
None, the function returns the correct value.
Tracking Issue
https://github.com/flyteorg/flyte/issues/
Follow-up issue
NA
OR
https://github.com/flyteorg/flyte/issues/
flyteorg/flytekit
✅ All checks have passed
30/30 successful checksacoustic-carpenter-78188
02/06/2023, 3:10 PM