From 754bdfdccd26df0fa8c5875e92d96ed1084e0d71 Mon Sep 17 00:00:00 2001 From: pnadolny13 Date: Tue, 11 Apr 2023 16:29:58 -0400 Subject: [PATCH 1/4] dont validate tables, trust they exist for now --- tap_dynamodb/tap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tap_dynamodb/tap.py b/tap_dynamodb/tap.py index dd8f58a..4d7e06c 100644 --- a/tap_dynamodb/tap.py +++ b/tap_dynamodb/tap.py @@ -83,7 +83,9 @@ def discover_streams(self) -> list[streams.TableStream]: """ obj = DynamoDB(self.config) discovered_streams = [] - for table_name in obj.list_tables(self.config.get("tables")): + for table_name in ( + self.config.get("tables") or obj.list_tables() + ): try: stream = streams.TableStream( tap=self, From 37ee5bac64947ce934975c9c2f0b6c4fa27b77b1 Mon Sep 17 00:00:00 2001 From: pnadolny13 Date: Tue, 11 Apr 2023 16:30:24 -0400 Subject: [PATCH 2/4] remove movie reference from sample code error message --- tap_dynamodb/dynamo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tap_dynamodb/dynamo.py b/tap_dynamodb/dynamo.py index 1e86112..5a530da 100644 --- a/tap_dynamodb/dynamo.py +++ b/tap_dynamodb/dynamo.py @@ -54,7 +54,8 @@ def get_items_iter( done = start_key is None except ClientError as err: self.logger.error( - "Couldn't scan for movies. Here's why: %s: %s", + "Couldn't scan for %s. Here's why: %s: %s", + table_name, err.response["Error"]["Code"], err.response["Error"]["Message"], ) From 1f32ad84716113a04fc5de2a6a19b2bab384cc26 Mon Sep 17 00:00:00 2001 From: pnadolny13 Date: Tue, 11 Apr 2023 16:30:38 -0400 Subject: [PATCH 3/4] add default region to assume role workflow --- tap_dynamodb/aws_authenticators.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tap_dynamodb/aws_authenticators.py b/tap_dynamodb/aws_authenticators.py index 74b33af..6b46f18 100644 --- a/tap_dynamodb/aws_authenticators.py +++ b/tap_dynamodb/aws_authenticators.py @@ -109,4 +109,5 @@ def _assume_role(self, session, role_arn): aws_access_key_id=response["Credentials"]["AccessKeyId"], aws_secret_access_key=response["Credentials"]["SecretAccessKey"], aws_session_token=response["Credentials"]["SessionToken"], + region_name=self.aws_default_region, ) From 6cb520e8a8a7012af1f55f26778f8097744a15dc Mon Sep 17 00:00:00 2001 From: pnadolny13 Date: Tue, 11 Apr 2023 16:33:56 -0400 Subject: [PATCH 4/4] reformat --- tap_dynamodb/tap.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tap_dynamodb/tap.py b/tap_dynamodb/tap.py index 4d7e06c..b48aee6 100644 --- a/tap_dynamodb/tap.py +++ b/tap_dynamodb/tap.py @@ -83,9 +83,7 @@ def discover_streams(self) -> list[streams.TableStream]: """ obj = DynamoDB(self.config) discovered_streams = [] - for table_name in ( - self.config.get("tables") or obj.list_tables() - ): + for table_name in self.config.get("tables") or obj.list_tables(): try: stream = streams.TableStream( tap=self,