https://prefect.io logo
Title
t

Tim Enders

06/08/2022, 7:41 PM
Where can I find the signals FAIL, SKIP, etc. in Prefect 2.0? I am getting an error when importing them from the old place.
1
API Reference makes me think they don't exist. If not, how would I replicate raising a SKIP() signal?
a

Anna Geller

06/08/2022, 7:54 PM
What is your use case you would like to apply signals for? In 2.0 you can write arbitrary Python in your flow and raise exceptions so signals are no longer needed - curious to hear more about your use case
t

Tim Enders

06/08/2022, 7:57 PM
I have been using signals mainly to skip over and "return" success when I have no data to process from some APIs I hit. I guess I should just evaluate in the flow function and return what exactly?
k

Kevin Kho

06/08/2022, 8:17 PM
You can do:
@flow
def myflow():
    a = task_one():
    if a.result() is not None:
        task_two(a)
something like that. That is a native Python SKIP
👍 1
t

Tim Enders

06/08/2022, 9:16 PM
Thanks!
👍 1