Hey everybody! Is there any way to stop the execu...
# questions
l
Hey everybody! Is there any way to stop the execution without yielding an error? I have tried
sys.exit(0)
but the output anyway results in an ERROR. Is it possible to stop the execution without generating that type of output error?
👀 1
It doesn't work either
I wonder if the our implementation of the runner/session encapsulates this
You might be able to do this
Copy code
import os
os._exit(0)
n
Can you elaborate? what are you trying to do?
👍 1
l
Given a certain condition, theres no need to run any posterior nodes or pipelines. Therefore, I need to break the execution so the other nodes or pipelines are not executed.
r
Hi @Lucas Fiorini, You can use a
before_pipeline_run
hook to have a custom condition and decide to exit. You can explore more here. Please let me know if this works. Thank you
l
@Ravi Kumar Pilla I guess I would still need to use some sort ox exit statement inside that hook, right? I the condition is met, then I would
sys.exit(0)
and this would (presumably) generate the same error.
d
You can also just return a No-Op dataset and handle that downstream
r
before_pipeline_run
spec has run_params. Not sure if it works but can you try -
run_params["from_nodes"] = []
or as @datajoely mentioned you can return an empty dataset and handle it downstream
👍 1
l
@Ravi Kumar Pilla Sounds promissing, I'll try it and let you know if it works
Thanks!
👍 1