Here is how to retrieve the value set by dbutils.notebook.exit(value) from a Job Run in Databricks:
The feature to set a value on the notebook exit is quite well documented (see first comment for the link to the docs). However, where does the value end up when the notebook is used in a job run? That is something not quite straight forward and took me some time to figure it out.
The value can be programmatically retrieved via the Jobs API. But again, it does not show up in the regular run info provided by a get_run call to the API. Only by calling get_run_output for the specific Notebook Task you can retrieve the value.
The whole process seems a bit bulky, but after all it is quite useful if you want to store some custom values in a job run.
Do you use this feature or have you been aware of it yet?
