Skip to content

Commit

Permalink
πŸ› Fix boto3.Session not having a endpoint_url param (#1090)
Browse files Browse the repository at this point in the history
* πŸ› Fix `boto3.Session` not having a `endpoint_url` param

* ♻️ Make the logic more robust
  • Loading branch information
trymzet authored Oct 11, 2024
1 parent 6ac2487 commit 2cbe46d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/viadot/sources/redshift_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ def __init__(
"Credentials not specified. Falling back to `boto3` default credentials."
)

if self.credentials:
endpoint_url = self.credentials.get("endpoint_url")
if endpoint_url:
wr.config.s3_endpoint_url = endpoint_url

self._session = None
self._con = None

Expand All @@ -121,7 +126,6 @@ def session(self) -> boto3.session.Session:
profile_name=self.credentials.get("profile_name"),
aws_access_key_id=self.credentials.get("aws_access_key_id"),
aws_secret_access_key=self.credentials.get("aws_secret_access_key"),
endpoint_url=self.credentials.get("endpoint_url"),
)
return self._session

Expand Down

0 comments on commit 2cbe46d

Please sign in to comment.