https://prefect.io logo
k

kevin

07/19/2022, 2:24 PM
Hi guys, does Prefect's
case
statement for True/False logic allow me to do something analogos to this python logic:
Copy code
a = get_val_or_none()
if not a:
    a = 'some new val'
do_something_with_a(a)
k

Kevin Kho

07/19/2022, 2:26 PM
Not quite, you need to use
merge
like:
Copy code
a = get_val_or_none()
with case(a, False):
    b = some_new_task()
c = merge(b,a)
do_something_with_c(c)
merge will give the first non null value
k

kevin

07/19/2022, 2:35 PM
understood thank you !
4 Views