phillipleblanc commented on code in PR #10080:
URL:
https://github.com/apache/arrow-datafusion/pull/10080#discussion_r1565988185
##########
datafusion-cli/src/object_storage.rs:
##########
@@ -72,10 +81,30 @@ pub async fn get_s3_object_store_builder(
builder = builder.with_credentials(credentials);
}
- if let Some(region) = &aws_options.region {
+ if let Some(region) = region {
builder = builder.with_region(region);
}
+ if let Some(endpoint) = endpoint {
+ // Make a nicer error if the user hasn't allowed http and the endpoint
+ // is http as the default message is "URL scheme is not allowed"
+ if let Ok(endpoint_url) = Url::try_from(endpoint.as_str()) {
+ if !matches!(allow_http, Some(true)) && endpoint_url.scheme() ==
"http" {
+ return config_err!(
+ "Invalid endpoint: {endpoint}. \
+ HTTP is not allowed for S3 endpoints. \
+ To allow HTTP, set 'aws.allow_http' to true"
+ );
Review Comment:
❤️
--
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]