tustvold commented on code in PR #8012:
URL: https://github.com/apache/arrow-datafusion/pull/8012#discussion_r1377957777


##########
datafusion/core/src/datasource/listing/url.rs:
##########
@@ -138,15 +137,13 @@ impl ListingTableUrl {
         .map_err(|_| DataFusionError::Internal(format!("Can not open path: 
{s}")))?;
         // TODO: Currently we do not have an IO-related error variant that 
accepts ()
         //       or a string. Once we have such a variant, change the error 
type above.
-        Ok(Self::new(url, glob))
+        Self::try_new(url, glob)
     }
 
     /// Creates a new [`ListingTableUrl`] from a url and optional glob 
expression
-    fn new(url: Url, glob: Option<Pattern>) -> Self {
-        let decoded_path =
-            
percent_encoding::percent_decode_str(url.path()).decode_utf8_lossy();
-        let prefix = Path::from(decoded_path.as_ref());
-        Self { url, prefix, glob }
+    fn try_new(url: Url, glob: Option<Pattern>) -> Result<Self> {
+        let prefix = Path::from_url_path(url.path())?;

Review Comment:
   As an added bonus this complexity is now handled for us by the object_store 
crate :tada:



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to