Skip to content

Commit 6cf4f40

Browse files
authored
Merge pull request #2109 from agonzalez2014/patch-1
Enhance the notebook exit() method documentation
2 parents b079d55 + bdcf4be commit 6cf4f40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/data-engineering/microsoft-spark-utilities.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ mssparkutils.notebook.help()
169169

170170
```console
171171

172-
exit(value: String): void -> This method lets you exit a notebook with a value.
172+
exit(value: String): Raises NotebookExit Exception -> This method lets you exit a notebook with a value.
173173
run(path: String, timeoutSeconds: int, arguments: Map): String -> This method runs a notebook and returns its exit value.
174174
```
175175

@@ -292,7 +292,7 @@ This method exits a notebook with a value. You can run nesting function calls in
292292

293293
- When you call an *exit()* function from a notebook interactively, the Fabric notebook throws an exception, skips running subsequent cells, and keeps the Spark session alive.
294294

295-
- When you orchestrate a notebook in a pipeline that calls an *exit()* function, the notebook activity returns with an exit value, completes the pipeline run, and stops the Spark session.
295+
- When you orchestrate a notebook in a pipeline that calls an *exit()* function, the notebook activity returns with an exit value, completes the pipeline run, and stops the Spark session. Do not enclose the *exit()* function around a try/catch as this NotebookExit Exception must propagate for the pipeline to get the return value.
296296

297297
- When you call an *exit()* function in a notebook that is being referenced, Fabric Spark will stop the further execution of the referenced notebook, and continue to run the next cells in the main notebook that calls the *run()* function. For example: Notebook1 has three cells and calls an *exit()* function in the second cell. Notebook2 has five cells and calls *run(notebook1)* in the third cell. When you run Notebook2, Notebook1 stops at the second cell when hitting the *exit()* function. Notebook2 continues to run its fourth cell and fifth cell.
298298

0 commit comments

Comments
 (0)