@@ -104,15 +104,13 @@ def _fetch_range(
104
104
range_values : Tuple [int , int ],
105
105
bucket : str ,
106
106
key : str ,
107
- boto3_primitives : _utils . Boto3PrimitivesType ,
107
+ s3_client : boto3 . client ,
108
108
boto3_kwargs : Dict [str , Any ],
109
109
) -> Tuple [int , bytes ]:
110
110
start , end = range_values
111
111
_logger .debug ("Fetching: s3://%s/%s - Range: %s-%s" , bucket , key , start , end )
112
- boto3_session : boto3 .Session = _utils .boto3_from_primitives (primitives = boto3_primitives )
113
- client : boto3 .client = _utils .client (service_name = "s3" , session = boto3_session )
114
112
resp : Dict [str , Any ] = _utils .try_it (
115
- f = client .get_object ,
113
+ f = s3_client .get_object ,
116
114
ex = _S3_RETRYABLE_ERRORS ,
117
115
base = 0.5 ,
118
116
max_num_tries = 6 ,
@@ -314,7 +312,7 @@ def _merge_range(ranges: List[Tuple[int, bytes]]) -> bytes:
314
312
315
313
def _fetch_range_proxy (self , start : int , end : int ) -> bytes :
316
314
_logger .debug ("Fetching: s3://%s/%s - Range: %s-%s" , self ._bucket , self ._key , start , end )
317
- boto3_primitives : _utils . Boto3PrimitivesType = _utils .boto3_to_primitives ( boto3_session = self ._boto3_session )
315
+ s3_client : boto3 . client = _utils .client ( service_name = "s3" , session = self ._boto3_session )
318
316
boto3_kwargs : Dict [str , Any ] = get_botocore_valid_kwargs (
319
317
function_name = "get_object" , s3_additional_kwargs = self ._s3_additional_kwargs
320
318
)
@@ -325,7 +323,7 @@ def _fetch_range_proxy(self, start: int, end: int) -> bytes:
325
323
range_values = (start , end ),
326
324
bucket = self ._bucket ,
327
325
key = self ._key ,
328
- boto3_primitives = boto3_primitives ,
326
+ s3_client = s3_client ,
329
327
boto3_kwargs = boto3_kwargs ,
330
328
)[1 ]
331
329
sizes : Tuple [int , ...] = _utils .get_even_chunks_sizes (
@@ -344,7 +342,7 @@ def _fetch_range_proxy(self, start: int, end: int) -> bytes:
344
342
ranges ,
345
343
itertools .repeat (self ._bucket ),
346
344
itertools .repeat (self ._key ),
347
- itertools .repeat (boto3_primitives ),
345
+ itertools .repeat (s3_client ),
348
346
itertools .repeat (boto3_kwargs ),
349
347
)
350
348
),
0 commit comments