-
Notifications
You must be signed in to change notification settings - Fork 188
Fix Azure URL parsing #604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,7 +52,7 @@ impl From<Error> for super::Error { | |
| /// - `memory:///` -> [`InMemory`] | ||
| /// - `s3://bucket/path` -> [`AmazonS3`](crate::aws::AmazonS3) (also supports `s3a`) | ||
| /// - `gs://bucket/path` -> [`GoogleCloudStorage`](crate::gcp::GoogleCloudStorage) | ||
| /// - `az://account/container/path` -> [`MicrosoftAzure`](crate::azure::MicrosoftAzure) (also supports `adl`, `azure`, `abfs`, `abfss`) | ||
| /// - `[az|abfs[s]]://container[@<account>.<host>]/path` -> [`MicrosoftAzure`](crate::azure::MicrosoftAzure) | ||
| /// - `http://mydomain/path` -> [`HttpStore`](crate::http::HttpStore) | ||
| /// - `https://mydomain/path` -> [`HttpStore`](crate::http::HttpStore) | ||
| /// | ||
|
|
@@ -110,8 +110,9 @@ impl ObjectStoreScheme { | |
| ("memory", None) => (Self::Memory, url.path()), | ||
| ("s3" | "s3a", Some(_)) => (Self::AmazonS3, url.path()), | ||
| ("gs", Some(_)) => (Self::GoogleCloudStorage, url.path()), | ||
| ("az", Some(_)) => (Self::MicrosoftAzure, strip_bucket().unwrap_or_default()), | ||
| ("adl" | "azure" | "abfs" | "abfss", Some(_)) => (Self::MicrosoftAzure, url.path()), | ||
| ("az" | "adl" | "azure" | "abfs" | "abfss", Some(_)) => { | ||
| (Self::MicrosoftAzure, url.path()) | ||
| } | ||
| ("http", Some(_)) => (Self::Http, url.path()), | ||
| ("https", Some(host)) => { | ||
| if host.ends_with("dfs.core.windows.net") | ||
|
|
@@ -299,11 +300,35 @@ mod tests { | |
| (ObjectStoreScheme::MicrosoftAzure, "path"), | ||
| ), | ||
| ( | ||
| "az://account/container", | ||
| (ObjectStoreScheme::MicrosoftAzure, ""), | ||
| "az://container/path", | ||
| (ObjectStoreScheme::MicrosoftAzure, "path"), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ), | ||
| ( | ||
| "az://container@account/path", | ||
| (ObjectStoreScheme::MicrosoftAzure, "path"), | ||
| ), | ||
| ( | ||
| "abfs://container/path", | ||
| (ObjectStoreScheme::MicrosoftAzure, "path"), | ||
| ), | ||
| ( | ||
| "abfs://container@account/path", | ||
| (ObjectStoreScheme::MicrosoftAzure, "path"), | ||
| ), | ||
| ( | ||
| "abfss://container/path", | ||
| (ObjectStoreScheme::MicrosoftAzure, "path"), | ||
| ), | ||
| ( | ||
| "abfss://container@account/path", | ||
| (ObjectStoreScheme::MicrosoftAzure, "path"), | ||
| ), | ||
| ( | ||
| "adl://container/path", | ||
| (ObjectStoreScheme::MicrosoftAzure, "path"), | ||
| ), | ||
| ( | ||
| "az://account/container/path", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we please keep this test so it is clearer what is the difference in behavior? I am not sure what this URL will parse to now
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is here #604 (comment) Just renamed |
||
| "adl://container@account/path", | ||
| (ObjectStoreScheme::MicrosoftAzure, "path"), | ||
| ), | ||
| ( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted to drop
azureas it is a custom format AFAICT, andadlas it is deprecated by azure.Whilst still supported for compatibility, people shouldn't be using them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be clear, you stopped documenting that
azureis supported, but the code still supports it