<?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: Run Script for all Lakehouse Files / Lakehouse files storage account key in Hack Together</title>
    <link>https://community.fabric.microsoft.com/t5/Hack-Together/Run-Script-for-all-Lakehouse-Files-Lakehouse-files-storage/m-p/3731669#M153</link>
    <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;You can easily list all files in a Lakehouse folder from your notebook. Just make sure to connect the lakehouse in the left pane first. that will then become your default lakehouse in the notebook&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;file_path = &lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;"/lakehouse/default/Files/yoursubfoldername_here&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;lst = os.listdir(file_path)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;then you can iterate through the files and apply the same logic to each file in a loop.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for file in lst:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; --do stuff&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;So the trick is not to run the same notebook on each file, but to read out the files in the notebook and the run the same logic on each file.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;you could create a pipeline that reads out the list of files in a folder and then call a notebook and pass the file path as a parameter, but that just adds unnecessary complexity.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if you're looking for the fully qualified path to where your files are in the lakehouse, then you can grab it from the properties on the Files folder&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 28 Feb 2024 21:18:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-02-28T21:18:28Z</dc:date>
    <item>
      <title>Run Script for all Lakehouse Files / Lakehouse files storage account key</title>
      <link>https://community.fabric.microsoft.com/t5/Hack-Together/Run-Script-for-all-Lakehouse-Files-Lakehouse-files-storage/m-p/3731004#M149</link>
      <description>&lt;P&gt;I would like to use the Notebook to run the same script for all files stored in the Lakehouse files. How can this be done? If there´s a need to get the storage account key for lakehouse files, where can this be obtained?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 15:21:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Hack-Together/Run-Script-for-all-Lakehouse-Files-Lakehouse-files-storage/m-p/3731004#M149</guid>
      <dc:creator>Quique</dc:creator>
      <dc:date>2024-02-28T15:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Run Script for all Lakehouse Files / Lakehouse files storage account key</title>
      <link>https://community.fabric.microsoft.com/t5/Hack-Together/Run-Script-for-all-Lakehouse-Files-Lakehouse-files-storage/m-p/3731669#M153</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;You can easily list all files in a Lakehouse folder from your notebook. Just make sure to connect the lakehouse in the left pane first. that will then become your default lakehouse in the notebook&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;file_path = &lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;"/lakehouse/default/Files/yoursubfoldername_here&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;lst = os.listdir(file_path)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;then you can iterate through the files and apply the same logic to each file in a loop.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for file in lst:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; --do stuff&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;So the trick is not to run the same notebook on each file, but to read out the files in the notebook and the run the same logic on each file.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;you could create a pipeline that reads out the list of files in a folder and then call a notebook and pass the file path as a parameter, but that just adds unnecessary complexity.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if you're looking for the fully qualified path to where your files are in the lakehouse, then you can grab it from the properties on the Files folder&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Feb 2024 21:18:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Hack-Together/Run-Script-for-all-Lakehouse-Files-Lakehouse-files-storage/m-p/3731669#M153</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-28T21:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Run Script for all Lakehouse Files / Lakehouse files storage account key</title>
      <link>https://community.fabric.microsoft.com/t5/Hack-Together/Run-Script-for-all-Lakehouse-Files-Lakehouse-files-storage/m-p/3731800#M154</link>
      <description>&lt;P&gt;Thanks! I'm sure this works and almost worked for me, but for some reason I keep getting this error &lt;SPAN&gt;Spark_Ambiguous_MsSparkUtils_UseMountedPathFailure.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'll keep checking.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Feb 2024 22:33:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Hack-Together/Run-Script-for-all-Lakehouse-Files-Lakehouse-files-storage/m-p/3731800#M154</guid>
      <dc:creator>Quique</dc:creator>
      <dc:date>2024-02-28T22:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Run Script for all Lakehouse Files / Lakehouse files storage account key</title>
      <link>https://community.fabric.microsoft.com/t5/Hack-Together/Run-Script-for-all-Lakehouse-Files-Lakehouse-files-storage/m-p/3732046#M155</link>
      <description>&lt;P&gt;UPDATE: It worked now, thanks again! There were a couple of problems: the delta tables I was creating had blank spaces in their names. Also, when creating the delta tables, I changed to use the qualified path, instead of the relative path.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 02:19:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Hack-Together/Run-Script-for-all-Lakehouse-Files-Lakehouse-files-storage/m-p/3732046#M155</guid>
      <dc:creator>Quique</dc:creator>
      <dc:date>2024-02-29T02:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Run Script for all Lakehouse Files / Lakehouse files storage account key</title>
      <link>https://community.fabric.microsoft.com/t5/Hack-Together/Run-Script-for-all-Lakehouse-Files-Lakehouse-files-storage/m-p/3746445#M198</link>
      <description>&lt;P&gt;For me it only works when i use the /lakehouse/default/Files... Path.&lt;BR /&gt;However when i try to use it with the abfs path, do get the following Error:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;FileNotFoundError&lt;/SPAN&gt;&lt;SPAN&gt;: [Errno 2] No such file or directory: 'abfss://.../input'&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;file_path = f"abfss://.../input"
lst = os.listdir(file_path)
lst&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any idea what causes that issue?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 15:08:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Hack-Together/Run-Script-for-all-Lakehouse-Files-Lakehouse-files-storage/m-p/3746445#M198</guid>
      <dc:creator>BoSe</dc:creator>
      <dc:date>2024-03-06T15:08:52Z</dc:date>
    </item>
  </channel>
</rss>

