Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop Execution of Databricks notebook after specific cell

Please suggest how to stop the execution of code after a specific cell in a Databricks notebook.

I Tried sys.exit(0) (Python code) and dbutils.notebook.exit() on Databricks notebook. However, neither worked.

like image 543
sizo_abe Avatar asked Sep 11 '25 23:09

sizo_abe


1 Answers

dbutils.notebook.exit() does not work because you need to put the string argument, it fails silently without it. To make it work you should write something like:

dbutils.notebook.exit("whatever reason to make it stop")
like image 167
Robert Avatar answered Sep 14 '25 17:09

Robert



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!