diff --git a/docs/data-engineering/microsoft-spark-utilities.md b/docs/data-engineering/microsoft-spark-utilities.md index 389304fad..52a886e81 100644 --- a/docs/data-engineering/microsoft-spark-utilities.md +++ b/docs/data-engineering/microsoft-spark-utilities.md @@ -169,7 +169,7 @@ mssparkutils.notebook.help() ```console -exit(value: String): void -> This method lets you exit a notebook with a value. +exit(value: String): Raises NotebookExit Exception -> This method lets you exit a notebook with a value. run(path: String, timeoutSeconds: int, arguments: Map): String -> This method runs a notebook and returns its exit value. ``` @@ -292,7 +292,7 @@ This method exits a notebook with a value. You can run nesting function calls in - 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. -- 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. +- 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. - 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.