tustvold commented on code in PR #3109:
URL: https://github.com/apache/arrow-rs/pull/3109#discussion_r1021980619


##########
object_store/src/azure/client.rs:
##########
@@ -149,10 +150,16 @@ pub(crate) struct AzureClient {
 impl AzureClient {
     /// create a new instance of [AzureClient]
     pub fn new(config: AzureConfig) -> Self {
-        let client = reqwest::ClientBuilder::new()
-            .https_only(!config.allow_http)
-            .build()
-            .unwrap();
+        let builder = ReqwestClient::builder();
+        let client = if let Some(url) = config.proxy_url.as_ref() {
+            let pr: Proxy = Proxy::all(url).unwrap();

Review Comment:
   I think it would be better to make AzureClient::new return a `Result`. This 
won't be a breaking change as `AzureClient` is crate private



##########
object_store/src/gcp/mod.rs:
##########
@@ -790,12 +803,24 @@ impl GoogleCloudStorageBuilder {
             service_account_path,
             client,
             retry_config,
+            proxy_url,
         } = self;
 
         let bucket_name = bucket_name.ok_or(Error::MissingBucketName {})?;
         let service_account_path =
             service_account_path.ok_or(Error::MissingServiceAccountPath)?;
-        let client = client.unwrap_or_else(Client::new);
+        let client = client.unwrap_or(match proxy_url {

Review Comment:
   ```suggestion
           let client = client.unwrap_or_else(|| match proxy_url {
   ```
   
   It's a minor nit, but this avoids creating a client eagerly, only to just 
discard it



##########
object_store/src/azure/mod.rs:
##########
@@ -516,8 +526,19 @@ impl MicrosoftAzureBuilder {
             retry_config,
             allow_http,
             authority_host,
+            proxy_url,
         } = self;
 
+        // check if proxy_url is usable

Review Comment:
   See above, I think it would be cleaner to make AzureClient::new fallible



##########
object_store/src/gcp/mod.rs:
##########
@@ -782,6 +787,14 @@ impl GoogleCloudStorageBuilder {
         self
     }
 
+    /// Set proxy url used for connection
+    ///
+    /// if a pre-built client is provided with this builder then the proxy_url 
is just ignored

Review Comment:
   We don't appear to expose this, so I think this can be ignored



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