<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Capturing notebook return codes in databricks jobs in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/capturing-notebook-return-codes-in-databricks-jobs/m-p/25337#M17610</link>
    <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I currently am running a number of notebook jobs from Azure Data Factory. A new requirement has come up where I need to capture a return code in ADF that has been generated from the note. I tried using &amp;nbsp;&lt;/P&gt;&lt;P&gt;dbutils.notebook.exit(json.dumps({"return_value":"[some text or code]})) but this is not visible from the output of the job. I could however see this value if I triggered that notebook from a call notebook task in ADF.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something, any assistance greatly appreciated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Oct 2022 13:17:17 GMT</pubDate>
    <dc:creator>labromb</dc:creator>
    <dc:date>2022-10-28T13:17:17Z</dc:date>
    <item>
      <title>Capturing notebook return codes in databricks jobs</title>
      <link>https://community.databricks.com/t5/data-engineering/capturing-notebook-return-codes-in-databricks-jobs/m-p/25337#M17610</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I currently am running a number of notebook jobs from Azure Data Factory. A new requirement has come up where I need to capture a return code in ADF that has been generated from the note. I tried using &amp;nbsp;&lt;/P&gt;&lt;P&gt;dbutils.notebook.exit(json.dumps({"return_value":"[some text or code]})) but this is not visible from the output of the job. I could however see this value if I triggered that notebook from a call notebook task in ADF.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something, any assistance greatly appreciated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 13:17:17 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/capturing-notebook-return-codes-in-databricks-jobs/m-p/25337#M17610</guid>
      <dc:creator>labromb</dc:creator>
      <dc:date>2022-10-28T13:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Capturing notebook return codes in databricks jobs</title>
      <link>https://community.databricks.com/t5/data-engineering/capturing-notebook-return-codes-in-databricks-jobs/m-p/112935#M44363</link>
      <description>&lt;P&gt;I am looking for this too, as I want to run a job from an Azure DevOps pipeline authorized to access Databricks.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 14:09:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/capturing-notebook-return-codes-in-databricks-jobs/m-p/112935#M44363</guid>
      <dc:creator>JaviRuiz</dc:creator>
      <dc:date>2025-03-18T14:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Capturing notebook return codes in databricks jobs</title>
      <link>https://community.databricks.com/t5/data-engineering/capturing-notebook-return-codes-in-databricks-jobs/m-p/112952#M44366</link>
      <description>&lt;P&gt;I tried dbutils.notebook.exit(&amp;lt;value&amp;gt;) where value is 0 and 1. I also tried sys.exit(&amp;lt;value&amp;gt;).&amp;nbsp;&lt;BR /&gt;None of this produces a difference in the output of the databricks CLI command&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;databricks jobs run-now --json '{"job_id": &amp;lt;JOB_ID&amp;gt;, "job_parameters": {"will_exit": "yes"}}'&lt;/LI-CODE&gt;&lt;P&gt;Furthermore, if I use sys.exit(&amp;lt;value&amp;gt;) the API doesn't return a result in JSON, but fails:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;⣷ Error: failed to reach TERMINATED or SKIPPED, got INTERNAL_ERROR: Task IntegrationTest failed with message: Workload failed, see run output for details. This caused all downstream tasks to get skipped&lt;/LI-CODE&gt;&lt;P&gt;It's a pity...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 15:22:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/capturing-notebook-return-codes-in-databricks-jobs/m-p/112952#M44366</guid>
      <dc:creator>JaviRuiz</dc:creator>
      <dc:date>2025-03-18T15:22:11Z</dc:date>
    </item>
  </channel>
</rss>

