<?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: Incompatibility between synapseutils_2.12:1.6.2 (Scala) and Fabric notebookutils.lakehouse.list in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Incompatibility-between-synapseutils-2-12-1-6-2-Scala-and-Fabric/m-p/5126564#M15334</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1544873"&gt;@s_hampe&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you for reaching out to the Microsoft Fabric Community Forum. Also, thanks to&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1357760"&gt;@Tamanchu&lt;/a&gt;,&amp;nbsp;for those inputs on this thread.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Has your issue been resolved? If the response provided by the community member&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1357760"&gt;@Tamanchu&lt;/a&gt;, addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.&lt;BR /&gt;&lt;BR /&gt;Thank you for using the Microsoft Community Forum.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Mar 2026 04:46:59 GMT</pubDate>
    <dc:creator>v-kpoloju-msft</dc:creator>
    <dc:date>2026-03-06T04:46:59Z</dc:date>
    <item>
      <title>Incompatibility between synapseutils_2.12:1.6.2 (Scala) and Fabric notebookutils.lakehouse.list</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Incompatibility-between-synapseutils-2-12-1-6-2-Scala-and-Fabric/m-p/5049397#M15145</link>
      <description>&lt;P&gt;This post is part issue-report, part workaround suggestion.&lt;/P&gt;&lt;H1&gt;Issue&lt;/H1&gt;&lt;P&gt;We are running Spark Jobs written in Scala and we use&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;com.microsoft.azure.synapse:synapseutils_2.12:1.6.2&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;to access (among other things) notebookutils. I can find no official documentation that indicates that synapseutils is meant to be used with Fabric as well, but as it contains notebookutils (which is a Fabric utility library), that seems implied.&lt;/P&gt;&lt;P&gt;This library exposes dummy stubs, so calls to notebookutils can compile locally.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In particular we want to call the following function on notebookutils.lakehouse:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;def list(workspaceId: String = ???): Array[Artifact]&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;However, when running the job in Fabric, this function call triggers the following error:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;java.lang.NoSuchMethodError:
notebookutils.lakehouse$.list(java.lang.String)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The (Python) signature in the &lt;A href="https://learn.microsoft.com/en-us/fabric/data-engineering/notebook-utilities" target="_self"&gt;official documentation is&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# List all Lakehouse artifacts
list(workspaceId: String = "", maxResults: Int = 1000): Array[Artifact]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apparently, the default arguments are not translated correctly in the Scala version. In particular, the Scala version does not expose a version of list with 2 arguments.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; Calling notebookutils.lakehouse.list(wsid) within a Spark Scala &lt;EM&gt;Notebook &lt;/EM&gt;works without issue, the problem lies solely within the (dummy) function stubs provided by the synapseutils library.&amp;nbsp;&lt;/P&gt;&lt;H1&gt;Workaround&lt;/H1&gt;&lt;P&gt;A very very ugly workaround is to apply reflection to the notebookutils.lakehouses object at runtime to find the 2-argument version of list:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;object FabricLakehouseCompat {

  def listLakehouses(workspaceId: String, maxResults: Int = 1000): Array[AnyRef] = {
    val lh = notebookutils.lakehouse
    val cls = lh.getClass

    val method = cls.getMethod(
      "list",
      classOf[String],
      java.lang.Integer.TYPE
    )

    method
      .invoke(lh, workspaceId, Int.box(maxResults))
      .asInstanceOf[Array[AnyRef]]
  }

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Further reflection can be applied to convert the list of AnyRefs to Artifacts again.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2026 08:27:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Incompatibility-between-synapseutils-2-12-1-6-2-Scala-and-Fabric/m-p/5049397#M15145</guid>
      <dc:creator>s_hampe</dc:creator>
      <dc:date>2026-02-18T08:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Incompatibility between synapseutils_2.12:1.6.2 (Scala) and Fabric notebookutils.lakehouse.list</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Incompatibility-between-synapseutils-2-12-1-6-2-Scala-and-Fabric/m-p/5124300#M15281</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1544873"&gt;@s_hampe&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Great investigation, your reflection-based workaround is solid, and I can confirm this is a known limitation rather than a simple bug.&lt;/P&gt;&lt;P&gt;Root Cause: NotebookUtils is not supported in Spark Job Definitions&lt;/P&gt;&lt;P&gt;The official Microsoft documentation for NotebookUtils explicitly states:&lt;/P&gt;&lt;P&gt;"Notebook utilities aren't applicable for Apache Spark job definitions (SJD)."&lt;/P&gt;&lt;P&gt;This means the notebookutils.lakehouse.list() method (and other notebookutils APIs) are designed to run inside Fabric Notebooks only, not in compiled Spark Job Definitions. The synapseutils_2.12:1.6.2 library provides compilation stubs, but these stubs are intentionally incomplete, they were never meant to fully replicate the runtime API available inside Notebooks.&lt;/P&gt;&lt;P&gt;That's why the method signature mismatch exists:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Runtime (Notebook): list(workspaceId: String = "", maxResults: Int = 1000)&lt;/LI&gt;&lt;LI&gt;Stubs (synapseutils JAR): list(workspaceId: String) missing the maxResults parameter&lt;BR /&gt;Your Workaround is the Right Approach&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your Java reflection approach is actually the correct pattern for this scenario. Since the stubs don't match the runtime, reflection bypasses the compilation check and calls the method directly at runtime.&lt;/P&gt;&lt;P&gt;Alternative: Use the Fabric REST API&lt;/P&gt;&lt;P&gt;For Spark Job Definitions, the recommended approach is to use the Fabric REST API instead of notebookutils:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tamanchu_0-1772448312787.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1328585i2324AD5934CFB501/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tamanchu_0-1772448312787.png" alt="Tamanchu_0-1772448312787.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The Lakehouse Management REST API provides full CRUD operations and works reliably in both Notebooks and Spark Job Definitions.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Suggestion to Microsoft&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It would be helpful if the synapseutils library either:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Matched the full runtime signatures (even for SJD stubs)&lt;/LI&gt;&lt;LI&gt;Or threw a clear UnsupportedOperationException with a message like "notebookutils.lakehouse is not supported in Spark Job Definitions"&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This would save developers significant debugging time.&lt;/P&gt;&lt;P&gt;Hope this helps! Feel free to ask if you have follow-up questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2026 10:47:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Incompatibility-between-synapseutils-2-12-1-6-2-Scala-and-Fabric/m-p/5124300#M15281</guid>
      <dc:creator>Tamanchu</dc:creator>
      <dc:date>2026-03-02T10:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Incompatibility between synapseutils_2.12:1.6.2 (Scala) and Fabric notebookutils.lakehouse.list</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Incompatibility-between-synapseutils-2-12-1-6-2-Scala-and-Fabric/m-p/5124377#M15283</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1357760"&gt;@Tamanchu&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your feedback.&lt;/P&gt;&lt;P&gt;As for the support for Spark Jobs: The notice you mention ("&lt;SPAN&gt;Notebook utilities aren't applicable for Apache Spark job definitions (SJD)." is found in this section:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-engineering/notebook-utilities#notebook-utilities" target="_blank"&gt;https://learn.microsoft.com/en-us/fabric/data-engineering/notebook-utilities#notebook-utilities&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;which refers to a subset of functions of NotebookUtils intended specifically for Notebooks (notebookutils.notebook). It makes complete sense that this particular subset is not applicable to Spark Jobs.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For the other functions, no such notice is present - so I would still consider it a bug in the synapseutils library.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I agree with your suggestion though: synapseutils should match the correct signatures.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2026 12:58:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Incompatibility-between-synapseutils-2-12-1-6-2-Scala-and-Fabric/m-p/5124377#M15283</guid>
      <dc:creator>s_hampe</dc:creator>
      <dc:date>2026-03-02T12:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Incompatibility between synapseutils_2.12:1.6.2 (Scala) and Fabric notebookutils.lakehouse.list</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Incompatibility-between-synapseutils-2-12-1-6-2-Scala-and-Fabric/m-p/5124515#M15285</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1544873"&gt;@s_hampe&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You’re right that the documentation explicitly mentions only the notebook-specific namespace. My interpretation was based on the observed behavior in SJD where lakehouse APIs are partially stubbed.&lt;BR /&gt;If the behavior isn’t officially documented as unsupported, then this likely deserves clarification or a fix in the synapseutils library.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2026 16:13:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Incompatibility-between-synapseutils-2-12-1-6-2-Scala-and-Fabric/m-p/5124515#M15285</guid>
      <dc:creator>Tamanchu</dc:creator>
      <dc:date>2026-03-02T16:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Incompatibility between synapseutils_2.12:1.6.2 (Scala) and Fabric notebookutils.lakehouse.list</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Incompatibility-between-synapseutils-2-12-1-6-2-Scala-and-Fabric/m-p/5126564#M15334</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1544873"&gt;@s_hampe&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you for reaching out to the Microsoft Fabric Community Forum. Also, thanks to&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1357760"&gt;@Tamanchu&lt;/a&gt;,&amp;nbsp;for those inputs on this thread.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Has your issue been resolved? If the response provided by the community member&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1357760"&gt;@Tamanchu&lt;/a&gt;, addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.&lt;BR /&gt;&lt;BR /&gt;Thank you for using the Microsoft Community Forum.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2026 04:46:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Incompatibility-between-synapseutils-2-12-1-6-2-Scala-and-Fabric/m-p/5126564#M15334</guid>
      <dc:creator>v-kpoloju-msft</dc:creator>
      <dc:date>2026-03-06T04:46:59Z</dc:date>
    </item>
  </channel>
</rss>

