<?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 Is the Lakehouse Connection in Notebooks Supposed to Update when you select a different Lakehouse? in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Is-the-Lakehouse-Connection-in-Notebooks-Supposed-to-Update-when/m-p/4629082#M8284</link>
    <description>&lt;P&gt;Is this intended? I would assume if you pick a different lakehouse, it would automatically update so that anything you run in the notebook is on that lakehouse.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also ran a little experiment, the only time it ever updates the database you're actually hitting is when you change the default lakehouse (or if you do a spark.sql(f"USE {some_lakehouse}")). Has it always worked this way? Seems like I've spent way too much time in the notebooks to have never noticed this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tmjones2_0-1743159088374.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1255113i197B0E21EED639C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tmjones2_0-1743159088374.png" alt="tmjones2_0-1743159088374.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Mar 2025 10:59:24 GMT</pubDate>
    <dc:creator>tmjones2</dc:creator>
    <dc:date>2025-03-28T10:59:24Z</dc:date>
    <item>
      <title>Is the Lakehouse Connection in Notebooks Supposed to Update when you select a different Lakehouse?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Is-the-Lakehouse-Connection-in-Notebooks-Supposed-to-Update-when/m-p/4629082#M8284</link>
      <description>&lt;P&gt;Is this intended? I would assume if you pick a different lakehouse, it would automatically update so that anything you run in the notebook is on that lakehouse.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also ran a little experiment, the only time it ever updates the database you're actually hitting is when you change the default lakehouse (or if you do a spark.sql(f"USE {some_lakehouse}")). Has it always worked this way? Seems like I've spent way too much time in the notebooks to have never noticed this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tmjones2_0-1743159088374.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1255113i197B0E21EED639C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tmjones2_0-1743159088374.png" alt="tmjones2_0-1743159088374.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2025 10:59:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Is-the-Lakehouse-Connection-in-Notebooks-Supposed-to-Update-when/m-p/4629082#M8284</guid>
      <dc:creator>tmjones2</dc:creator>
      <dc:date>2025-03-28T10:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Is the Lakehouse Connection in Notebooks Supposed to Update when you select a different Lakehous</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Is-the-Lakehouse-Connection-in-Notebooks-Supposed-to-Update-when/m-p/4631316#M8311</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/137529"&gt;@tmjones2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P class="" data-start="106" data-end="406"&gt;Yes, this is actually the expected behavior in Fabric notebooks. When you select a different Lakehouse in the UI, it doesn’t automatically update the active connection in the notebook. Instead, the notebook sticks to the Lakehouse it was originally connected to unless you explicitly change it.&lt;/P&gt;
&lt;P class="" data-start="106" data-end="406"&gt;The likely reason behind it is to prevent disruptions if you're running a long session, switching the Lakehouse in the UI won’t suddenly reroute your queries and cause unintended issues. The notebook kernel maintains its own session state, so even though the UI makes it seem like the Lakehouse should change, the actual connection remains the same.&lt;/P&gt;
&lt;P class="" data-start="821" data-end="881"&gt;To make sure you're querying the right Lakehouse, you can:&lt;/P&gt;
&lt;OL data-start="883" data-end="1163"&gt;
&lt;LI class="" data-start="883" data-end="974"&gt;
&lt;P class="" data-start="886" data-end="974"&gt;Set the default Lakehouse – This ensures the correct one is used when you restart the session.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="" data-start="975" data-end="1163"&gt;
&lt;P class="" data-start="978" data-end="1048"&gt;Explicitly switch Lakehouses in SQL – As you mentioned, running:&lt;BR /&gt;spark.sql(f"USE {some_lakehouse}")&lt;/P&gt;
&lt;P class="" data-start="1112" data-end="1163"&gt;will point your session to the correct Lakehouse.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P class="" data-start="1165" data-end="1416"&gt;It’s easy to overlook this since the UI makes it seem like selecting a new Lakehouse should apply everywhere, but the notebook maintains its own connection. A best practice is to always set the Lakehouse explicitly in your notebook if you're switching.&lt;/P&gt;
&lt;P class="" data-start="1418" data-end="1464"&gt;For more details, check out these resources:&lt;/P&gt;
&lt;UL data-start="1466" data-end="2374"&gt;
&lt;LI class="" data-start="1466" data-end="1767"&gt;
&lt;P class="" data-start="1468" data-end="1767"&gt;Connect lakehouses and notebooks: &lt;A class="" href="https://learn.microsoft.com/en-us/fabric/data-engineering/how-to-use-notebook#connect-lakehouses-and-notebooks" target="_new" rel="noopener" data-start="1541" data-end="1765"&gt;https://learn.microsoft.com/en-us/fabric/data-engineering/how-to-use-notebook#connect-lakehouses-and-notebooks&lt;/A&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="" data-start="1769" data-end="2055"&gt;
&lt;P class="" data-start="1771" data-end="2055"&gt;Programmatically Removing &amp;amp; Updating Default Lakehouse in a Notebook: &lt;A class="" href="https://fabric.guru/programmatically-removing-updating-default-lakehouse-of-a-fabric-notebook" target="_new" rel="noopener" data-start="1863" data-end="2053"&gt;https://fabric.guru/programmatically-removing-updating-default-lakehouse-of-a-fabric-notebook&lt;/A&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="" data-start="2057" data-end="2374"&gt;
&lt;P class="" data-start="2059" data-end="2374"&gt;Update attached Lakehouse using code: &lt;A class="" href="https://community.fabric.microsoft.com/t5/Data-Engineering/Update-Notebook-attached-lakehouse-using-code/m-p/4379350" target="_new" rel="noopener" data-start="2136" data-end="2372"&gt;https://community.fabric.microsoft.com/t5/Data-Engineering/Update-Notebook-attached-lakehouse-using-code/m-p/4379350&lt;/A&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="" data-start="2376" data-end="2439"&gt;Hope this helps! Let us know if you have any other questions.&lt;/P&gt;
&lt;P class="" data-start="2376" data-end="2439"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="" data-start="2376" data-end="2439"&gt;&lt;EM&gt;If this post helps, then please consider "Accept it as the solution" to help the other members find it more quickly and a kudos would be appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;Best Regards,&lt;BR /&gt;Vinay.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 09:46:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Is-the-Lakehouse-Connection-in-Notebooks-Supposed-to-Update-when/m-p/4631316#M8311</guid>
      <dc:creator>v-veshwara-msft</dc:creator>
      <dc:date>2025-03-31T09:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is the Lakehouse Connection in Notebooks Supposed to Update when you select a different Lakehous</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Is-the-Lakehouse-Connection-in-Notebooks-Supposed-to-Update-when/m-p/4660914#M8739</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/137529"&gt;@tmjones2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Following up to see if your query has been resolved. If so, please consider marking the helpful response as the Accepted Solution to assist others with similar issues. If you still need assistance, feel free to reach out.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Apr 2025 11:11:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Is-the-Lakehouse-Connection-in-Notebooks-Supposed-to-Update-when/m-p/4660914#M8739</guid>
      <dc:creator>v-veshwara-msft</dc:creator>
      <dc:date>2025-04-21T11:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Is the Lakehouse Connection in Notebooks Supposed to Update when you select a different Lakehous</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Is-the-Lakehouse-Connection-in-Notebooks-Supposed-to-Update-when/m-p/4674326#M8962</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/137529"&gt;@tmjones2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Just checking in to see if you query is resolved and if any responses were helpful. If so, kindly consider marking the helpful reply as 'Accepted Solution' to help others with similar queries.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, feel free to reach out for further assistance.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 09:22:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Is-the-Lakehouse-Connection-in-Notebooks-Supposed-to-Update-when/m-p/4674326#M8962</guid>
      <dc:creator>v-veshwara-msft</dc:creator>
      <dc:date>2025-04-30T09:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Is the Lakehouse Connection in Notebooks Supposed to Update when you select a different Lakehous</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Is-the-Lakehouse-Connection-in-Notebooks-Supposed-to-Update-when/m-p/4680301#M9074</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/137529"&gt;@tmjones2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;We’re following up once more regarding your query. If it has been resolved, please mark the helpful reply as the &lt;STRONG&gt;Accepted Solution&lt;/STRONG&gt; to assist others facing similar challenges.&lt;/P&gt;
&lt;P&gt;If you still need assistance, please let us know.&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 05 May 2025 12:08:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Is-the-Lakehouse-Connection-in-Notebooks-Supposed-to-Update-when/m-p/4680301#M9074</guid>
      <dc:creator>v-veshwara-msft</dc:creator>
      <dc:date>2025-05-05T12:08:14Z</dc:date>
    </item>
  </channel>
</rss>

