Skip to content

Commit ddaed54

Browse files
SyedShahmeerAli12Syed Shahmeer Ali
andauthored
Fix S3 client initialization with signature_version and addressing_style (#9911)
### What problem does this PR solve? Moved `signature_version` and `addressing_style` parameters to a `Config` object from `botocore.config` `signature_version` is now passed as `Config(signature_version='v4')` `addressing_style` is now passed as `Config(s3={'addressing_style': 'path'})` The `Config` object is then passed to `boto3.client()` via the `config` parameter ## Changes Made - Modified `rag/utils/s3_conn.py` in the `__open__()` method - Updated parameter handling logic to use `config_kwargs` dictionary - Maintained backward compatibility for configurations without these parameters ## Related Issue Fixes #9910 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Co-authored-by: Syed Shahmeer Ali <ashahmeer73@gmail.com>
1 parent 1ee9c0b commit ddaed54

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

rag/utils/s3_conn.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,13 @@ def __open__(self):
8080
s3_params['region_name'] = self.region_name
8181
if self.endpoint_url:
8282
s3_params['endpoint_url'] = self.endpoint_url
83+
84+
# Configure signature_version and addressing_style through Config object
8385
if self.signature_version:
84-
s3_params['signature_version'] = self.signature_version
86+
config_kwargs['signature_version'] = self.signature_version
8587
if self.addressing_style:
86-
s3_params['addressing_style'] = self.addressing_style
88+
config_kwargs['s3'] = {'addressing_style': self.addressing_style}
89+
8790
if config_kwargs:
8891
s3_params['config'] = Config(**config_kwargs)
8992

0 commit comments

Comments
 (0)