Using papermill CLI how to finish earlier a jupyter notebook if certain conditions are not met?

Viewed 418

Papermill throws exception if I need to finish the code earlier. For example with quit():

nbclient.exceptions.DeadKernelError: Kernel died

I would like to know if there is a way to instruct the code exit without papermill throwing the exception.

Example:

# check conditions if all met then run full notebook
# if not, then just finish

condition1=True

if condition1:
    quit() # if condition is not met then finish here

print('continue the logic')
0 Answers
Related