Skip to content

Commit

Permalink
Merge branch 'main' into datafusion-44
Browse files Browse the repository at this point in the history
  • Loading branch information
rtyler authored Dec 22, 2024
2 parents d0787ed + cdc6473 commit 1a4a94e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crates/aws/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ fn is_aws(options: &StorageOptions) -> bool {
if options.0.contains_key(constants::AWS_S3_LOCKING_PROVIDER) {
return true;
}
!options.0.contains_key(constants::AWS_ENDPOINT_URL)
// Options at this stage should only contain 'aws_endpoint' in lowercase
// due to with_env_s3
!(options.0.contains_key("aws_endpoint") || options.0.contains_key(constants::AWS_ENDPOINT_URL))
}

/// Options used to configure the [S3StorageBackend].
Expand Down Expand Up @@ -819,9 +821,15 @@ mod tests {
let options = StorageOptions::from(minio);
assert!(!is_aws(&options));

let minio: HashMap<String, String> = hashmap! {
"aws_endpoint".to_string() => "http://minio:8080".to_string(),
};
let options = StorageOptions::from(minio);
assert!(!is_aws(&options));

let localstack: HashMap<String, String> = hashmap! {
constants::AWS_FORCE_CREDENTIAL_LOAD.to_string() => "true".to_string(),
constants::AWS_ENDPOINT_URL.to_string() => "http://minio:8080".to_string(),
"aws_endpoint".to_string() => "http://minio:8080".to_string(),
};
let options = StorageOptions::from(localstack);
assert!(is_aws(&options));
Expand Down

0 comments on commit 1a4a94e

Please sign in to comment.