<?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 Re: MalformedInputException when using extended ascii characters in dbutils.notebook.exit() in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/malformedinputexception-when-using-extended-ascii-characters-in/m-p/92713#M38519</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/124534"&gt;@jfpatenaude&lt;/a&gt;&amp;nbsp;&lt;A href="https://www.starbucks-secretmenu.com" target="_self"&gt;starbuckssecretmenu&lt;/A&gt; wrote:&lt;BR /&gt;&lt;P&gt;I have a specific use case where I call another notebook using the&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbutils.notebook.&lt;/SPAN&gt;&lt;SPAN&gt;run&lt;/SPAN&gt;&lt;SPAN&gt;() function. The other notebook do some processing and return a string in the&amp;nbsp;dbutils.notebook.exit() function to the caller notebook. The returned string has some french special characters in it like à, é, è and because of that, the calling notebook executes for about 5 minutes longer than the called notebook and eventually ends with an exception:&amp;nbsp;com.databricks.WorkflowException: java.nio.charset.MalformedInputException: Input length = 1&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;If I remove the special characters, everything works fine. Same thing If I use the .encode('ascii', 'remove') function on my string, but I need to have the the correct string returned with my accents. Is there a way to preserve my string intact? I'm on the Databricks Runtime Version 13.3 LTS.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You can reproduce the behavior using these two simple notebooks.&lt;/DIV&gt;&lt;DIV&gt;Caller Notebook:&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;output&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; dbutils.notebook.&lt;/SPAN&gt;&lt;SPAN&gt;run&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'called_notebook'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;600&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;Called Notebook:&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbutils.notebook.&lt;/SPAN&gt;&lt;SPAN&gt;exit&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"La mise à jour des tables des données raffinées est terminée"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&gt;- Called Notebook&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;# Called Notebook&lt;BR /&gt;output_string = "La mise à jour des tables des données raffinées est terminée"&lt;BR /&gt;# Encode to UTF-8&lt;BR /&gt;output_bytes = output_string.encode('utf-8')&lt;BR /&gt;## Convert to string format before returnin&lt;BR /&gt;dbutils.notebook.exit(output_bytes.decode('utf-8'))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Caller Notebook&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;# Caller Notebook&lt;BR /&gt;output = dbutils.notebook.run('called_notebook', 600)&lt;BR /&gt;# You may want to ensure it's in the right format after calling&lt;BR /&gt;output_string = output.encode('utf-8').decode('utf-8')&lt;BR /&gt;print(output_string)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Oct 2024 04:19:36 GMT</pubDate>
    <dc:creator>jennie258fitz</dc:creator>
    <dc:date>2024-10-04T04:19:36Z</dc:date>
    <item>
      <title>MalformedInputException when using extended ascii characters in dbutils.notebook.exit()</title>
      <link>https://community.databricks.com/t5/data-engineering/malformedinputexception-when-using-extended-ascii-characters-in/m-p/92687#M38508</link>
      <description>&lt;P&gt;I have a specific use case where I call another notebook using the&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbutils.notebook.&lt;/SPAN&gt;&lt;SPAN&gt;run&lt;/SPAN&gt;&lt;SPAN&gt;() function. The other notebook do some processing and return a string in the&amp;nbsp;dbutils.notebook.exit() function to the caller notebook. The returned string has some french special characters in it like à, é, è and because of that, the calling notebook executes for about 5 minutes longer than the called notebook and eventually ends with an exception:&amp;nbsp;com.databricks.WorkflowException: java.nio.charset.MalformedInputException: Input length = 1&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;If I remove the special characters, everything works fine. Same thing If I use the .encode('ascii', 'remove') function on my string, but I need to have the the correct string returned with my accents. Is there a way to preserve my string intact? I'm on the Databricks Runtime Version 13.3 LTS.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You can reproduce the behavior using these two simple notebooks.&lt;/DIV&gt;&lt;DIV&gt;Caller Notebook:&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;output&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; dbutils.notebook.&lt;/SPAN&gt;&lt;SPAN&gt;run&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'called_notebook'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;600&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;Called Notebook:&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbutils.notebook.&lt;/SPAN&gt;&lt;SPAN&gt;exit&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"La mise à jour des tables des données raffinées est terminée"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Oct 2024 18:49:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/malformedinputexception-when-using-extended-ascii-characters-in/m-p/92687#M38508</guid>
      <dc:creator>jfpatenaude</dc:creator>
      <dc:date>2024-10-03T18:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: MalformedInputException when using extended ascii characters in dbutils.notebook.exit()</title>
      <link>https://community.databricks.com/t5/data-engineering/malformedinputexception-when-using-extended-ascii-characters-in/m-p/92713#M38519</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/124534"&gt;@jfpatenaude&lt;/a&gt;&amp;nbsp;&lt;A href="https://www.starbucks-secretmenu.com" target="_self"&gt;starbuckssecretmenu&lt;/A&gt; wrote:&lt;BR /&gt;&lt;P&gt;I have a specific use case where I call another notebook using the&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbutils.notebook.&lt;/SPAN&gt;&lt;SPAN&gt;run&lt;/SPAN&gt;&lt;SPAN&gt;() function. The other notebook do some processing and return a string in the&amp;nbsp;dbutils.notebook.exit() function to the caller notebook. The returned string has some french special characters in it like à, é, è and because of that, the calling notebook executes for about 5 minutes longer than the called notebook and eventually ends with an exception:&amp;nbsp;com.databricks.WorkflowException: java.nio.charset.MalformedInputException: Input length = 1&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;If I remove the special characters, everything works fine. Same thing If I use the .encode('ascii', 'remove') function on my string, but I need to have the the correct string returned with my accents. Is there a way to preserve my string intact? I'm on the Databricks Runtime Version 13.3 LTS.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You can reproduce the behavior using these two simple notebooks.&lt;/DIV&gt;&lt;DIV&gt;Caller Notebook:&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;output&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; dbutils.notebook.&lt;/SPAN&gt;&lt;SPAN&gt;run&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'called_notebook'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;600&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;Called Notebook:&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbutils.notebook.&lt;/SPAN&gt;&lt;SPAN&gt;exit&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"La mise à jour des tables des données raffinées est terminée"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&gt;- Called Notebook&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;# Called Notebook&lt;BR /&gt;output_string = "La mise à jour des tables des données raffinées est terminée"&lt;BR /&gt;# Encode to UTF-8&lt;BR /&gt;output_bytes = output_string.encode('utf-8')&lt;BR /&gt;## Convert to string format before returnin&lt;BR /&gt;dbutils.notebook.exit(output_bytes.decode('utf-8'))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Caller Notebook&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;# Caller Notebook&lt;BR /&gt;output = dbutils.notebook.run('called_notebook', 600)&lt;BR /&gt;# You may want to ensure it's in the right format after calling&lt;BR /&gt;output_string = output.encode('utf-8').decode('utf-8')&lt;BR /&gt;print(output_string)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 04:19:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/malformedinputexception-when-using-extended-ascii-characters-in/m-p/92713#M38519</guid>
      <dc:creator>jennie258fitz</dc:creator>
      <dc:date>2024-10-04T04:19:36Z</dc:date>
    </item>
  </channel>
</rss>

