<?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: Using dbutils.fs.ls on URI with square brackets results in error in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/using-dbutils-fs-ls-on-uri-with-square-brackets-results-in-error/m-p/6930#M2928</link>
    <description>&lt;P&gt;Hi Suteja, this looks like it might work, however I am using Scala. Is there an equivalent function in scala that can perform this function? Or is the source code anywhere so I can translate it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: &lt;/P&gt;&lt;P&gt;I take that back--I attempted to use this in python and it gives the same error as if i did not "unquote" the uri.  the [ and ] are left untouched when I print out the unquoted uri.  &lt;/P&gt;</description>
    <pubDate>Mon, 17 Apr 2023 17:39:44 GMT</pubDate>
    <dc:creator>Josh_Stafford</dc:creator>
    <dc:date>2023-04-17T17:39:44Z</dc:date>
    <item>
      <title>Using dbutils.fs.ls on URI with square brackets results in error</title>
      <link>https://community.databricks.com/t5/data-engineering/using-dbutils-fs-ls-on-uri-with-square-brackets-results-in-error/m-p/6928#M2926</link>
      <description>&lt;P&gt;Square brackets in ADLS are accepted, so why can't I list the files in the folder?  I have tried escaping the square brackets manually, but then the escaped values are re-escaped from %5B to %255B and %5D to %255D.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get:&lt;/P&gt;&lt;P&gt;URISyntaxException: Illegal character in path at index 188: abfss://container-name@***[***]***/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actual path replaced by ***.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 14:27:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/using-dbutils-fs-ls-on-uri-with-square-brackets-results-in-error/m-p/6928#M2926</guid>
      <dc:creator>Josh_Stafford</dc:creator>
      <dc:date>2023-03-28T14:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using dbutils.fs.ls on URI with square brackets results in error</title>
      <link>https://community.databricks.com/t5/data-engineering/using-dbutils-fs-ls-on-uri-with-square-brackets-results-in-error/m-p/6929#M2927</link>
      <description>&lt;P&gt;@Joshua Stafford​&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The URISyntaxException error you are encountering is likely due to the fact that square brackets are reserved characters in URIs (Uniform Resource Identifiers) and need to be properly encoded when used in a URL. In this case, it appears that the square brackets in the URI are not being encoded correctly, causing the error.&lt;/P&gt;&lt;P&gt;To resolve this issue, you can try encoding the square brackets manually using the appropriate percent encoding format. For example, you can replace "[" with "%5B" and "]" with "%5D" in the URI. However, it seems that you have already tried this approach and encountered further issues with the double encoding of "%".&lt;/P&gt;&lt;P&gt;In this case, you can try using the unquote() function from the urllib.parse module in Python to decode the URI before passing it to dbutils.fs.ls(). Here's an example:&lt;/P&gt;&lt;P&gt;python&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;from urllib.parse import unquote
&amp;nbsp;
# Example URI with encoded square brackets
uri = "abfss://container-name@***%5B***%5D***"
&amp;nbsp;
# Decode the URI
decoded_uri = unquote(uri)
&amp;nbsp;
# Use decoded URI in dbutils.fs.ls()
dbutils.fs.ls(decoded_uri)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This should properly decode the URI and allow you to list the files in the folder using dbutils.fs.ls() without encountering the URISyntaxException error. Note that you may need to adjust the encoding format depending on the specific requirements of your ADLS (Azure Data Lake Storage) environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 01:20:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/using-dbutils-fs-ls-on-uri-with-square-brackets-results-in-error/m-p/6929#M2927</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-05T01:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using dbutils.fs.ls on URI with square brackets results in error</title>
      <link>https://community.databricks.com/t5/data-engineering/using-dbutils-fs-ls-on-uri-with-square-brackets-results-in-error/m-p/6930#M2928</link>
      <description>&lt;P&gt;Hi Suteja, this looks like it might work, however I am using Scala. Is there an equivalent function in scala that can perform this function? Or is the source code anywhere so I can translate it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: &lt;/P&gt;&lt;P&gt;I take that back--I attempted to use this in python and it gives the same error as if i did not "unquote" the uri.  the [ and ] are left untouched when I print out the unquoted uri.  &lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 17:39:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/using-dbutils-fs-ls-on-uri-with-square-brackets-results-in-error/m-p/6930#M2928</guid>
      <dc:creator>Josh_Stafford</dc:creator>
      <dc:date>2023-04-17T17:39:44Z</dc:date>
    </item>
  </channel>
</rss>

