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


##########
object_store/src/aws/mod.rs:
##########
@@ -1094,12 +1103,30 @@ impl AmazonS3Builder {
     }
 }
 
+#[cfg(feature = "aws_profile")]
+fn profile_region(profile: String) -> Option<String> {
+    use crate::aws::credential::RegionProvider;
+    use futures::executor::block_on;
+
+    let provider = profile::ProfileProvider::new(profile, None);
+
+    block_on(provider.get_region())

Review Comment:
   ```suggestion
       Handle::current().block_on(provider.get_region())
   ```
   
   Using 
[`tokio::Handle`](https://docs.rs/tokio/latest/tokio/runtime/struct.Handle.html#method.block_on)
 might be safer, as I believe the upstream assumes tokio



##########
object_store/src/aws/credential.rs:
##########
@@ -291,6 +292,12 @@ fn canonicalize_headers(header_map: &HeaderMap) -> 
(String, String) {
     (signed_headers, canonical_headers)
 }
 
+/// Provides a region name where cloud resources are located
+#[async_trait]
+pub trait RegionProvider {

Review Comment:
   AFAICT get_region is only called on a concrete ProfileProvider, and so I 
don't see a region for this trait over just a regular member function



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