You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/05 19:13:17 UTC

[GitHub] [arrow] lidavidm commented on a diff in pull request #13633: ARROW-17057 [Python] S3FileSystem has no parameter for retry strategy

lidavidm commented on code in PR #13633:
URL: https://github.com/apache/arrow/pull/13633#discussion_r939153193


##########
python/pyarrow/_s3fs.pyx:
##########
@@ -300,6 +327,14 @@ cdef class S3FileSystem(FileSystem):
         options.allow_bucket_creation = allow_bucket_creation
         options.allow_bucket_deletion = allow_bucket_deletion
 
+        self._retry_strategy = retry_strategy
+        if isinstance(retry_strategy, AwsStandardRetryStrategy):
+            options.retry_strategy = CS3RetryStrategy.GetAwsStandardRetryStrategy(retry_strategy.max_attempts)
+        elif isinstance(retry_strategy, AwsDefaultRetryStrategy):
+            options.retry_strategy = CS3RetryStrategy.GetAwsDefaultRetryStrategy(retry_strategy.max_attempts)
+        else:
+            raise ValueError('Invalid retry_strategy.')

Review Comment:
   ```suggestion
               raise ValueError(f'Invalid retry_strategy {retry_strategy!r}')
   ```



##########
python/pyarrow/_s3fs.pyx:
##########
@@ -87,6 +87,29 @@ def resolve_s3_region(bucket):
 
     return frombytes(c_region)
 
+class AwsRetryStrategy(object):

Review Comment:
   Maybe 'S3RetryStrategy' to be in line with the C++ side? And then 'AwsStandardS3RetryStrategy'



##########
python/pyarrow/_s3fs.pyx:
##########
@@ -87,6 +87,29 @@ def resolve_s3_region(bucket):
 
     return frombytes(c_region)
 
+class AwsRetryStrategy(object):

Review Comment:
   ```suggestion
   class AwsRetryStrategy:
   ```



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