paleolimbot commented on code in PR #479:
URL: https://github.com/apache/sedona-db/pull/479#discussion_r2660108464
##########
rust/sedona/src/object_storage.rs:
##########
@@ -503,6 +585,121 @@ impl ConfigExtension for GcpOptions {
const PREFIX: &'static str = "gcp";
}
+/// This struct encapsulates Azure options one uses when setting up object
storage.
+#[cfg(feature = "azure")]
+#[derive(Default, Debug, Clone)]
+pub struct AzureOptions {
Review Comment:
Can you add a test for azure storage mirroring the ones for gcp and aws?
https://github.com/apache/sedona-db/blob/a43c9fc62365aab10d3c639dc72c59df01802c8f/rust/sedona/src/object_storage.rs#L632-L680
##########
rust/sedona-geoparquet/src/metadata.rs:
##########
@@ -329,6 +329,7 @@ pub struct GeoParquetColumnMetadata {
/// and multipolygons, it is not sufficient to specify `["MultiPolygon"]`,
but it is expected
/// to specify `["Polygon", "MultiPolygon"]`. Or if having 3D points, it
is not sufficient to
/// specify `["Point"]`, but it is expected to list `["Point Z"]`.
+ #[serde(default)]
Review Comment:
I'm guessing the planetary computer files are missing the `geometry_types`
key? (Probably add a comment here explaining that, because this is technically
out-of-spec)
##########
rust/sedona-geoparquet/src/provider.rs:
##########
@@ -139,6 +136,49 @@ impl GeoParquetReadOptions<'_> {
));
}
}
+ } else if key.starts_with("azure.") {
+ let common_azure_options = [
+ "azure.account_name",
+ "azure.account_key",
+ "azure.sas_token",
+ "azure.container_name",
+ "azure.use_emulator",
+ "azure.client_id",
+ "azure.client_secret",
+ "azure.tenant_id",
+ "azure.allow_http",
+ ];
+
+ if !common_azure_options.contains(&key.as_str()) {
+ let close_matches: Vec<&str> = common_azure_options
+ .iter()
+ .filter(|&&option| {
+ let key_start = &key[6..];
+ let option_start = &option[6..];
+
+ option_start.starts_with(key_start)
+ || key_start.starts_with(option_start)
+ || (key_start.len() >= 4
+ && option_start.len() >= 4
+ && key_start[..4] == option_start[..4])
+ })
+ .cloned()
+ .collect();
+
+ if !close_matches.is_empty() {
+ return Err(format!(
+ "Unknown Azure option '{}'. Did you mean: {}?",
+ key,
+ close_matches.join(", ")
+ ));
+ } else {
+ return Err(format!(
+ "Unknown Azure option '{}'. Valid options are: {}",
+ key,
+ common_azure_options.join(", ")
+ ));
Review Comment:
Can you add a test for this like this one?
https://github.com/apache/sedona-db/blob/a43c9fc62365aab10d3c639dc72c59df01802c8f/python/sedonadb/tests/test_context.py#L116-L133
--
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]