How can I exit from a Notebook which is used as a job?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2015 08:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2015 10:46 PM
@Mohan Kolli
The simple way to terminate execution based on a condition is to throw an exception; doing so will cause the run to terminate immediately. However, doing so will also cause the job to have a 'Failed' status.
In order to to maintain correctness semantics, you'd need to wrap each command in in a Try/Catch clause, and if the particular condition is met to simply perform a No-Op so that the run will complete successfully.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2019 06:26 AM
This does not work. When I have a cell (I am using pyspark) that has the command:
quit()Databricks skips over that particular cell,but still runs the next cell.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2019 11:32 AM
exit(value: String): void
Calling
dbutils.notebook.exit
in a job causes the notebook to complete successfully. If you want to cause the job to fail, throw an exception.

