Skip to content

Commit

Permalink
Implement pre-existing session support for dynamodb catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
shea-demandbase committed Oct 25, 2023
1 parent 6184bca commit 668857d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pyiceberg/catalog/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,15 @@
class DynamoDbCatalog(Catalog):
def __init__(self, name: str, **properties: str):
super().__init__(name, **properties)
self.dynamodb = boto3.client(DYNAMODB_CLIENT)
session = boto3.Session(
profile_name=properties.get("profile_name"),
region_name=properties.get("region_name"),
botocore_session=properties.get("botocore_session"),
aws_access_key_id=properties.get("aws_access_key_id"),
aws_secret_access_key=properties.get("aws_secret_access_key"),
aws_session_token=properties.get("aws_session_token"),
)
self.dynamodb = session.client(DYNAMODB_CLIENT)
self.dynamodb_table_name = self.properties.get(DYNAMODB_TABLE_NAME, DYNAMODB_TABLE_NAME_DEFAULT)
self._ensure_catalog_table_exists_or_create()

Expand Down

0 comments on commit 668857d

Please sign in to comment.