<?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: After moving mounted s3 bucket under unity catalog control, python file paths no longer work in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/after-moving-mounted-s3-bucket-under-unity-catalog-control/m-p/59835#M31515</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/93330"&gt;@chrisf_sts&lt;/a&gt;&amp;nbsp;,Thanks for bringing up your concerns, always happy to help&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;May I know which cluster access mode you are using to run the notebook commands?&lt;/P&gt;
&lt;P&gt;Can you please try to run this below command on Single user cluster access mode.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"with open("/mnt/my_files/my_json.json", "r") as f_read:&lt;BR /&gt;file_stuff = json.loads(f_read)"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can refer to this document for more details about the cluster access mode:&amp;nbsp;&lt;A href="https://docs.databricks.com/en/compute/configure.html#access-modes" target="_blank"&gt;https://docs.databricks.com/en/compute/configure.html#access-modes&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Also, a reason behind the error while trying to access the external dbfs mount file using "with open" is that you are using a shared access mode cluster. This is a known limitation for Shared Clusters, where /dbfs path is not accessible. You can try using a single-user cluster instead to access /dbfs which supports UC.&lt;/P&gt;
&lt;P&gt;Please refer:&lt;BR /&gt;&lt;A href="https://docs.databricks.com/clusters/configure.html#shared-access-mode-limitations" target="_blank"&gt;https://docs.databricks.com/clusters/configure.html#shared-access-mode-limitations&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://docs.databricks.com/en/dbfs/unity-catalog.html#how-does-dbfs-work-in-shared-access-mode" target="_blank"&gt;https://docs.databricks.com/en/dbfs/unity-catalog.html#how-does-dbfs-work-in-shared-access-mode&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And we also have a preview feature 'Improved Shared Clusters' that addresses some of the limitations of Shared Clusters.&lt;/P&gt;
&lt;P&gt;Please let me know if this helps and leave a like if this helps, followups are appreciated.&lt;BR /&gt;Kudos&lt;BR /&gt;Ayushi&lt;/P&gt;</description>
    <pubDate>Sat, 10 Feb 2024 12:49:23 GMT</pubDate>
    <dc:creator>Ayushi_Suthar</dc:creator>
    <dc:date>2024-02-10T12:49:23Z</dc:date>
    <item>
      <title>After moving mounted s3 bucket under unity catalog control, python file paths no longer work</title>
      <link>https://community.databricks.com/t5/data-engineering/after-moving-mounted-s3-bucket-under-unity-catalog-control/m-p/59828#M31512</link>
      <description>&lt;P&gt;I have been using a mounted external s3 bucket with json files up until a few days ago, when my company changed to using all file mounts under control of the unity catalog.&amp;nbsp; Suddenly I can no loner run a command like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;with&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;open&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"/mnt/my_files/my_json.json",&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"r"&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;f_read:&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file_stuff&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;json.&lt;/SPAN&gt;&lt;SPAN&gt;loads&lt;/SPAN&gt;&lt;SPAN&gt;(f_read)&lt;BR /&gt;&lt;BR /&gt;When I do I get the error:&amp;nbsp;&lt;BR /&gt;FileNotFoundError:&amp;nbsp;[Errno 2] No such file or directory:&amp;nbsp;'/mnt/my_files/my_json.json'&lt;BR /&gt;&lt;BR /&gt;If I run a dbutils command, like dbutils.fs.head("/mnt/my_files/my_json.json"), the same path works correctly.&amp;nbsp; Up until we brought the file mount under unity catalog, the with open command worked correctly.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I need to be able to open large json files in my databricks notebook and parse them, because the log files I'm reading come in with multiple large json objects that are not separated by proper json syntax, they are just one after the other in the file.&amp;nbsp; I attempted&amp;nbsp;to use the dbutils.fs.head command to do the parsing operation, but the files are too big and it truncates them so they're incomplete.&amp;nbsp; As far as I can tell, I can't stop that from happening.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2024 04:15:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/after-moving-mounted-s3-bucket-under-unity-catalog-control/m-p/59828#M31512</guid>
      <dc:creator>chrisf_sts</dc:creator>
      <dc:date>2024-02-10T04:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: After moving mounted s3 bucket under unity catalog control, python file paths no longer work</title>
      <link>https://community.databricks.com/t5/data-engineering/after-moving-mounted-s3-bucket-under-unity-catalog-control/m-p/59835#M31515</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/93330"&gt;@chrisf_sts&lt;/a&gt;&amp;nbsp;,Thanks for bringing up your concerns, always happy to help&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;May I know which cluster access mode you are using to run the notebook commands?&lt;/P&gt;
&lt;P&gt;Can you please try to run this below command on Single user cluster access mode.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"with open("/mnt/my_files/my_json.json", "r") as f_read:&lt;BR /&gt;file_stuff = json.loads(f_read)"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can refer to this document for more details about the cluster access mode:&amp;nbsp;&lt;A href="https://docs.databricks.com/en/compute/configure.html#access-modes" target="_blank"&gt;https://docs.databricks.com/en/compute/configure.html#access-modes&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Also, a reason behind the error while trying to access the external dbfs mount file using "with open" is that you are using a shared access mode cluster. This is a known limitation for Shared Clusters, where /dbfs path is not accessible. You can try using a single-user cluster instead to access /dbfs which supports UC.&lt;/P&gt;
&lt;P&gt;Please refer:&lt;BR /&gt;&lt;A href="https://docs.databricks.com/clusters/configure.html#shared-access-mode-limitations" target="_blank"&gt;https://docs.databricks.com/clusters/configure.html#shared-access-mode-limitations&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://docs.databricks.com/en/dbfs/unity-catalog.html#how-does-dbfs-work-in-shared-access-mode" target="_blank"&gt;https://docs.databricks.com/en/dbfs/unity-catalog.html#how-does-dbfs-work-in-shared-access-mode&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And we also have a preview feature 'Improved Shared Clusters' that addresses some of the limitations of Shared Clusters.&lt;/P&gt;
&lt;P&gt;Please let me know if this helps and leave a like if this helps, followups are appreciated.&lt;BR /&gt;Kudos&lt;BR /&gt;Ayushi&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2024 12:49:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/after-moving-mounted-s3-bucket-under-unity-catalog-control/m-p/59835#M31515</guid>
      <dc:creator>Ayushi_Suthar</dc:creator>
      <dc:date>2024-02-10T12:49:23Z</dc:date>
    </item>
  </channel>
</rss>

