chitralverma commented on code in PR #4077:
URL: https://github.com/apache/arrow-rs/pull/4077#discussion_r1165520700


##########
object_store/src/lib.rs:
##########
@@ -717,6 +726,139 @@ impl From<Error> for std::io::Error {
     }
 }
 
+/// Creates object store from provided url and options
+///
+/// The scheme of the provided url is used to instantiate the store. If the url
+/// scheme is cannot be mapped to a store, [`NotImplemented`] is raised. For 
invalid
+/// input, e.g. url with no scheme the default behaviour is to return
+/// [`local::LocalFileSystem`].
+///
+/// # Examples
+///
+/// ```
+///
+/// ```
+pub fn parse_url<
+    I: IntoIterator<Item = (impl AsRef<str>, impl Into<String> + Clone)> + 
Clone,
+>(
+    url: impl AsRef<str>,
+    options: I,
+) -> Result<Box<DynObjectStore>> {
+    let storage_url = url.as_ref();
+
+    if let Ok(url) = Url::parse(storage_url) {

Review Comment:
   The rationale bind this was to allow `memory` or `/` as valid inputs for 
`parse_url`. if we return Err on `Url::parse(storage_url)` then for memory 
users will have to pass `memory://` and `file://` 



##########
object_store/src/lib.rs:
##########
@@ -717,6 +726,139 @@ impl From<Error> for std::io::Error {
     }
 }
 
+/// Creates object store from provided url and options
+///
+/// The scheme of the provided url is used to instantiate the store. If the url
+/// scheme is cannot be mapped to a store, [`NotImplemented`] is raised. For 
invalid
+/// input, e.g. url with no scheme the default behaviour is to return
+/// [`local::LocalFileSystem`].
+///
+/// # Examples
+///
+/// ```
+///
+/// ```
+pub fn parse_url<
+    I: IntoIterator<Item = (impl AsRef<str>, impl Into<String> + Clone)> + 
Clone,
+>(
+    url: impl AsRef<str>,
+    options: I,
+) -> Result<Box<DynObjectStore>> {
+    let storage_url = url.as_ref();
+
+    if let Ok(url) = Url::parse(storage_url) {

Review Comment:
   The rationale behind this was to allow `memory` or `/` as valid inputs for 
`parse_url`. if we return Err on `Url::parse(storage_url)` then for memory 
users will have to pass `memory://` and `file://` 



-- 
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