https://prefect.io logo
m

Marwan Sarieddine

07/06/2020, 5:17 PM
Hi folks, what is the simplest way in prefect to specify that a task only execute based on the value of a boolean parameter, otherwise should get skipped ? nevermind - I just spotted signals
Copy code
from prefect.engine import signals

@task
def signal_task(run_task: bool):
   if not run_task:
       raise signals.SKIP()
k

Kyle Moon-Wright

07/06/2020, 5:21 PM
Hey @Marwan Sarieddine, There are probably a few ways depending on what you're doing, but I'd say the case operator with maybe some SKIP signal action.
m

Marwan Sarieddine

07/06/2020, 5:22 PM
@Kyle Moon-Wright thank you!
k

Kyle Moon-Wright

07/06/2020, 5:23 PM
You beat me! Good stuff. 👍