Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
tobazan
New Member

Python (not spark) Notebook exitValue issue

Is it a known issue that plain Python notebooks in Fabric don't return exitValue as expected?

 

I tried

```notebookutils.notebook.exit(json.dumps(json-object))```

as an alternative to the mssparkutils Ive been using with pySpark notebooks

but I get an empty string every time no matter how I set the notebook activity in my pipeline

 

1 ACCEPTED SOLUTION

Hi @tobazan,

 

Explicit Output Management: Instead of relying on the exit() method, store the output in a predefined location that the pipeline can read, e.g., Azure Blob Storage or a SQL database.

 

Regards,

Vinay Pabbu

View solution in original post

3 REPLIES 3
tobazan
New Member

@v-vpabbu 
not sure what you mean with "explicit output management within the notebook itself"
isn't that what Im doing with this line of code?

notebookutils.notebook.exit(json.dumps(json_object))


as I see it, until this doesn't work as it does in pySpark notebooks there are very few use cases for plain python notebooks
Id prefer not to start a spark pool for lightweight tasks but python notebooks seem to need some more polish

anyways, I appreciate your quick answer and support

Hi @tobazan,

 

Explicit Output Management: Instead of relying on the exit() method, store the output in a predefined location that the pipeline can read, e.g., Azure Blob Storage or a SQL database.

 

Regards,

Vinay Pabbu

v-vpabbu
Community Support
Community Support

Hi @tobazan,

 

Thank you for reaching out to Microsoft Fabric Community Forum.

 

The issue likely arises because plain Python notebooks in Fabric do not fully support the notebookutils.notebook.exit() method for returning exit values, unlike PySpark notebooks. The output may not propagate correctly due to pipeline configuration or limitations in handling Python notebook exits within Fabric.

 

You need to ensure the pipeline is set up to capture outputs and consider using alternative methods like manual error handling or explicit output management within the notebook itself.

 

Please le me know if you have any additional questions.


Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to give "Kudos"

 

Regards,
Vinay Pabbu

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

JanFabricDE_carousel

Fabric Monthly Update - January 2025

Explore the power of Python Notebooks in Fabric!

JanFabricDW_carousel

Fabric Monthly Update - January 2025

Unlock the latest Fabric Data Warehouse upgrades!

JanFabricDF_carousel

Fabric Monthly Update - January 2025

Take your data replication to the next level with Fabric's latest updates!