You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "r4ntix (via GitHub)" <gi...@apache.org> on 2023/04/07 13:49:14 UTC

[GitHub] [arrow-rs] r4ntix opened a new pull request, #4035: minor: make struct fields of Builders(S3/Azure/GCS) to pub

r4ntix opened a new pull request, #4035:
URL: https://github.com/apache/arrow-rs/pull/4035

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #4021 
   
   # Rationale for this change
    
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   See #4021 
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   - make struct fields of `AmazonS3Builder`, `MicrosoftAzureBuilder`, `GoogleCloudStorageBuilder` to pub
   
   # Are there any user-facing changes?
   
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] r4ntix commented on pull request #4035: minor: make struct fields of Builders(S3/Azure/GCS) to pub

Posted by "r4ntix (via GitHub)" <gi...@apache.org>.
r4ntix commented on PR #4035:
URL: https://github.com/apache/arrow-rs/pull/4035#issuecomment-1500389607

   @tustvold If we don't consider the consistency of value types, this is a better solution. I will submit a new commit for this, thanks.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] r4ntix commented on pull request #4035: minor: make struct fields of Builders(S3/Azure/GCS) to pub

Posted by "r4ntix (via GitHub)" <gi...@apache.org>.
r4ntix commented on PR #4035:
URL: https://github.com/apache/arrow-rs/pull/4035#issuecomment-1500861635

   I have submitted a new commit, use `get_config_value` method instead of public fields.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on pull request #4035: minor: make struct fields of Builders(S3/Azure/GCS) to pub

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #4035:
URL: https://github.com/apache/arrow-rs/pull/4035#issuecomment-1500308617

   Would it work to instead provide a method to get values by config key? Exposing the internals of these structs is problematic from the perspective of being able to make changes without breaking API compatibility


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold merged pull request #4035: Add get_config_value to AWS/Azure/GCP Builders

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold merged PR #4035:
URL: https://github.com/apache/arrow-rs/pull/4035


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on pull request #4035: minor: make struct fields of Builders(S3/Azure/GCS) to pub

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #4035:
URL: https://github.com/apache/arrow-rs/pull/4035#issuecomment-1500373489

   Or possibly even
   
   ```
   pub fn get_config_value(&self, key: &AmazonS3ConfigKey) -> Option<String> {
           match key {
               AmazonS3ConfigKey::AccessKeyId => self.access_key_id.clone(),
               AmazonS3ConfigKey::SecretAccessKey => self.secret_access_key.clone(),
               AmazonS3ConfigKey::Region | AmazonS3ConfigKey::DefaultRegion => {
                   self.region.clone()
               }
               AmazonS3ConfigKey::Bucket => self.bucket_name.clone(),
               AmazonS3ConfigKey::Endpoint => self.endpoint.clone(),
               AmazonS3ConfigKey::Token => self.token.clone(),
               AmazonS3ConfigKey::ImdsV1Fallback => Some(self.imdsv1_fallback.to_string()),
               AmazonS3ConfigKey::VirtualHostedStyleRequest => {
                   Some(self.virtual_hosted_style_request.to_string())
               }
               AmazonS3ConfigKey::MetadataEndpoint => self.metadata_endpoint.clone(),
               AmazonS3ConfigKey::Profile => self.profile.clone(),
               AmazonS3ConfigKey::UnsignedPayload => Some(self.unsigned_payload.to_string()),
               AmazonS3ConfigKey::Checksum => Some(self.checksum_algorithm.to_string()),
           }
       }
   ```


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] r4ntix commented on pull request #4035: minor: make struct fields of Builders(S3/Azure/GCS) to pub

Posted by "r4ntix (via GitHub)" <gi...@apache.org>.
r4ntix commented on PR #4035:
URL: https://github.com/apache/arrow-rs/pull/4035#issuecomment-1500352681

   > Would it work to instead provide a method to get values by config key? Exposing the internals of these structs is problematic from the perspective of being able to make changes without breaking API compatibility
   
   @tustvold thanks for the feedback.
   
   Do you mean providing a function like `try_with_option` to convert the config value back to `String` again? 
   I have considered code such as:
   ```rust
   pub fn get_config_value(&self, key: impl AsRef<str>) -> Result<Option<String>> {
           let value = match AmazonS3ConfigKey::from_str(key.as_ref())? {
               AmazonS3ConfigKey::AccessKeyId => self.access_key_id.clone(),
               AmazonS3ConfigKey::SecretAccessKey => self.secret_access_key.clone(),
               AmazonS3ConfigKey::Region | AmazonS3ConfigKey::DefaultRegion => {
                   self.region.clone()
               }
               AmazonS3ConfigKey::Bucket => self.bucket_name.clone(),
               AmazonS3ConfigKey::Endpoint => self.endpoint.clone(),
               AmazonS3ConfigKey::Token => self.token.clone(),
               AmazonS3ConfigKey::ImdsV1Fallback => Some(self.imdsv1_fallback.to_string()),
               AmazonS3ConfigKey::VirtualHostedStyleRequest => {
                   Some(self.virtual_hosted_style_request.to_string())
               }
               AmazonS3ConfigKey::MetadataEndpoint => self.metadata_endpoint.clone(),
               AmazonS3ConfigKey::Profile => self.profile.clone(),
               AmazonS3ConfigKey::UnsignedPayload => Some(self.unsigned_payload.to_string()),
               AmazonS3ConfigKey::Checksum => Some(self.checksum_algorithm.to_string()),
           };
           Ok(value)
       }
   ```


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org