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

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
Arundhati_Sen1
Frequent Visitor

Fabric Notebook notebookutils.notebook.exit('Output Value') not working

Hi, I am trying to run MS fabic notebook from data pipeline and get the exitValue which is required to perform next steps.
In my code I had to use python fintech library. When I am importing the fintech library after that notebookutils.notebook.exit() is not working. 

Step1 : 
Installed fintech library and checked  that notebookutils.notebook.exit is working as expected

Arundhati_Sen1_3-1740590256065.png


Step 2:
Once I import fintech after that getting exception : notebookutils.mssparkutils.handlers.notebookHandler.NotebookExit

Arundhati_Sen1_4-1740590307179.png


Any Idea why this is happening? Any workaround how I can still get exit value 

Complete Error Message:

Traceback (most recent call last): File "/tmp/ipykernel_12261/2317407240.py", line 1, in <module> notebookutils.notebook.exit({"error_count": error_count, "warning_count" : warning_count}) File "/home/trusted-service-user/cluster-env/clonedenv/lib/python3.11/site-packages/notebookutils/notebook.py", line 21, in exit nb.exit(value) File "/home/trusted-service-user/cluster-env/clonedenv/lib/python3.11/site-packages/notebookutils/mssparkutils/handlers/notebookHandler.py", line 102, in exit raise NotebookExit(value) notebookutils.mssparkutils.handlers.notebookHandler.NotebookExit: Output

Thanks in advance

 

1 ACCEPTED SOLUTION
v-pnaroju-msft
Community Support
Community Support

Hi Arundhati_Sen1,

Thank you for your update.

As a workaround, kindly review the following steps that may assist in resolving the issue:

  1. Please refer to the Fintech library's documentation or source code to identify any known issues or conflicts with other modules.
  2. If the exit function is critical, consider placing the exit logic before importing the Fintech library, as this may help prevent any interference.


    exit_value = {"status":"successful"}

    notebookutils.notebook.exit(exit_value)

    from fintech import register

    Additionally, please find below a reference link that may be helpful in resolving the issue:

    Solved: Re: Python (not spark) Notebook exitValue issue - Microsoft Fabric Community
    If you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.

    Thank you.

View solution in original post

11 REPLIES 11
v-pnaroju-msft
Community Support
Community Support

Hi Arundhati_Sen1,

We are following up to see if your query has been resolved. Should you have identified a solution, we kindly request you to share it with the community to assist others facing similar issues.

If our response was helpful, please mark it as the accepted solution and provide kudos, as this helps the broader community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi Arundhati_Sen1,

We are following up to see if your query has been resolved. Should you have identified a solution, we kindly request you to share it with the community to assist others facing similar issues.

If our response was helpful, please mark it as the accepted solution and provide kudos, as this helps the broader community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi Arundhati_Sen1,

We wanted to check in regarding your query, as we have not heard back from you. If you have resolved the issue, sharing the solution with the community would be greatly appreciated and could help others encountering similar challenges.

If you found our response useful, kindly mark it as the accepted solution and provide kudos to guide other members.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi Arundhati_Sen1,

Thank you for your update.

As a workaround, kindly review the following steps that may assist in resolving the issue:

  1. Please refer to the Fintech library's documentation or source code to identify any known issues or conflicts with other modules.
  2. If the exit function is critical, consider placing the exit logic before importing the Fintech library, as this may help prevent any interference.


    exit_value = {"status":"successful"}

    notebookutils.notebook.exit(exit_value)

    from fintech import register

    Additionally, please find below a reference link that may be helpful in resolving the issue:

    Solved: Re: Python (not spark) Notebook exitValue issue - Microsoft Fabric Community
    If you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.

    Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi Arundhati_Sen1,

We have not received a response from you regarding the query and were following up to check if you have found a resolution. If you have identified a solution, we kindly request you to share it with the community, as it may be helpful to others facing a similar issue.

If you find the response helpful, please mark it as the accepted solution and provide kudos, as this will help other members with similar queries.

Thank you.

Below solution does not help me with notebookutils.notebook.exit() issue. 
I need to import Fintech library for my solution.
Is there any alternative to notebookutils.notebook.exit() to get the response back to data pipeline? 

v-pnaroju-msft
Community Support
Community Support

Thankyou, @FabianSchut ,for your response.

 

Hi @Arundhati_Sen1,

 

We appreciate your inquiry on the Microsoft Fabric Community Forum.

 

The potential cause of this conflict could be the FinTech library, which might be overriding or modifying certain Python behaviors or modules on which notebookutils depends.

 

Kindly follow the steps mentioned below, which may help in resolving the issue:

1. Ensure that the version of the fintech library you are using is compatible with the current environment and notebookutils. Refer to the library’s documentation for any known issues.

2. If notebookutils.notebook.exit() is causing issues after importing the fintech library, consider using an alternative method to handle exits and return values. For example, instead of calling notebookutils.notebook.exit(), you may store the exit value in a variable and use it for further processing.

3. Implement try-except blocks around the code to handle exceptions gracefully, ensuring that the notebook generates an output even if an error occurs.

 

Additionally, please refer to the following link for further information:

NotebookUtils (former MSSparkUtils) for Fabric - Microsoft Fabric | Microsoft Learn

 

If you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.

 

Thank you.

FabianSchut
Super User
Super User

Hi,

 

You may try to import only required functions from the fintech package instead of the whole library. Like this example:

from fintech.sepa import Account, SEPACreditTransfer

 It may be the case that fintech has some own exit function that interferes with your used function.

So try to remove the whole 'import fintech' line and only import specific packages used.

As per official document before importing anyt module from fintech library it needs to be registered (Python Fintech Documentation - joonis.de)

Arundhati_Sen1_0-1740639262643.png


so I only imported register from fintech, not the entire library. But still issue persists. Any other workaround?

Arundhati_Sen1_1-1740639400734.png

Even if I only import register from fintech still same thing happening. Please help

Does it work when you use

mssparkutils.notebook.exit()

instead of notebookutils?

No I have verified that also is not working, same error

Arundhati_Sen1_0-1740996627642.png

 



Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.