<?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: Creating zip file in notebook in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4259455#M4846</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342"&gt;@lbendlin&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; ... will give a try and see how it goes.&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 27 Oct 2024 12:29:37 GMT</pubDate>
    <dc:creator>VenDaFabricator</dc:creator>
    <dc:date>2024-10-27T12:29:37Z</dc:date>
    <item>
      <title>Creating zip file in notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4259311#M4834</link>
      <description>&lt;P&gt;I got bunch of .delta table which in need to save as .json and zip them to supply it thrid party tool for futher processing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to get all .delta tables into .json files, but getting erro when zipping them.&lt;BR /&gt;&lt;BR /&gt;My .json files are in folder&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;'Files/temp/consolidated/'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&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="VenDaFabricator_0-1729999608512.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1189901iB477AA50095CB90B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VenDaFabricator_0-1729999608512.png" alt="VenDaFabricator_0-1729999608512.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now i want them to zip them all into 'sample.zip' ... he is my code, not sure what am doing wrong zipf.write can find the json_file_path though is right.&amp;nbsp; Any clues?? or is there different way to do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;with zipfile.ZipFile('sample.zip', 'w') as zipf:
    for f in filenames:
        json_file_path = f"Files/temp/consolidated/{f}"
        print (json_file_path)
        zipf.write(json_file_path,arcname=f)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Microsoft Fabric Context: The Fabric environment uses a virtual file system, which doesn’t provide direct file path access as in traditional file systems.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;zipfile.ZipFile.write&lt;STRONG&gt; Limitation: This method expects a direct file path, which isn't available for Fabric paths.&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Oct 2024 06:18:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4259311#M4834</guid>
      <dc:creator>VenDaFabricator</dc:creator>
      <dc:date>2024-10-27T06:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating zip file in notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4259443#M4842</link>
      <description>&lt;LI-CODE lang="markup"&gt;not sure what am doing wrong&lt;/LI-CODE&gt;
&lt;P&gt;It's pretty clear that what you are trying to do is not supported. Don't use zipFile - use its in-memory equivalent, whatever that is.&lt;/P&gt;</description>
      <pubDate>Sun, 27 Oct 2024 11:51:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4259443#M4842</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-10-27T11:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Creating zip file in notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4259452#M4844</link>
      <description>&lt;P&gt;Thanks lbendlin for the reply, do you got any sample code using in-memory to do this zipping for files or any links.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Oct 2024 12:14:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4259452#M4844</guid>
      <dc:creator>VenDaFabricator</dc:creator>
      <dc:date>2024-10-27T12:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Creating zip file in notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4259454#M4845</link>
      <description>&lt;P&gt;BytesIO , I guess.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://duckduckgo.com/?q=python+create+zip+file+in+memory&amp;amp;ia=web" target="_blank"&gt;python create zip file in memory at DuckDuckGo&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Oct 2024 12:27:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4259454#M4845</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-10-27T12:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating zip file in notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4259455#M4846</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342"&gt;@lbendlin&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; ... will give a try and see how it goes.&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Oct 2024 12:29:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4259455#M4846</guid>
      <dc:creator>VenDaFabricator</dc:creator>
      <dc:date>2024-10-27T12:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating zip file in notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4259788#M4855</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/681676"&gt;@VenDaFabricator&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;Maybe you can mount the lakehouse&amp;nbsp;through &lt;SPAN&gt;the Microsoft Spark Utilities package&lt;/SPAN&gt;? Mount would allow you to&amp;nbsp;&lt;SPAN&gt;use the local file API to access data&amp;nbsp;&lt;/SPAN&gt;under the mount point&amp;nbsp;&lt;SPAN&gt;as if it's stored in the local file system.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-engineering/microsoft-spark-utilities#how-to-mount-a-lakehouse:~:text=How%20to%20mount%20a%20lakehouse" target="_blank" rel="noopener"&gt;How to mount a lakehouse&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-engineering/microsoft-spark-utilities#access-files-under-the-mount-point-via-local-path:~:text=Access%20files%20under%20the%20mount%20point%20via%20local%20path" target="_blank" rel="noopener"&gt; Access files under the mount point via local path&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't used it to create zip files, you can give it a try.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Jing&lt;BR /&gt;&lt;EM&gt;If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos! &lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2024 03:06:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4259788#M4855</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-28T03:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Creating zip file in notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4268840#M4992</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/681676"&gt;@VenDaFabricator&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you resolved this issue? If any of the answers provided were helpful, please consider accepting them as a solution. If you have found other solutions, we would greatly appreciate it if you could share them with us. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Jing&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 08:52:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4268840#M4992</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-04T08:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Creating zip file in notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4269546#M4997</link>
      <description>&lt;P&gt;Why not use a copy command in a pipeline, you can iterate over all the table you want.&lt;/P&gt;&lt;P&gt;Delta Table as you source&lt;/P&gt;&lt;P&gt;OneLake File as your destination json file type, set the compression type to .zip&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="richbenmintz_0-1730744049588.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1193997i6D97185A66D3C0FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="richbenmintz_0-1730744049588.png" alt="richbenmintz_0-1730744049588.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 18:15:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Creating-zip-file-in-notebook/m-p/4269546#M4997</guid>
      <dc:creator>richbenmintz</dc:creator>
      <dc:date>2024-11-04T18:15:12Z</dc:date>
    </item>
  </channel>
</rss>

