diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a73c74..c403569 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.2.3 + * Fix error handling for log-based setup [#50](https://github.com/singer-io/tap-dynamodb/pull/50) + ## 1.2.2 * Fix empty string projection filter [#49](https://github.com/singer-io/tap-dynamodb/pull/49) diff --git a/setup.py b/setup.py index c01777c..80b1818 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name="tap-dynamodb", - version="1.2.2", + version="1.2.3", description="Singer.io tap for extracting data", author="Stitch", url="http://singer.io", diff --git a/tap_dynamodb/sync_strategies/log_based.py b/tap_dynamodb/sync_strategies/log_based.py index 64164fe..563a8a2 100644 --- a/tap_dynamodb/sync_strategies/log_based.py +++ b/tap_dynamodb/sync_strategies/log_based.py @@ -88,10 +88,11 @@ def sync_shard(shard, seq_number_bookmarks, streams_client, stream_arn, projecti record_message = deserializer.deserialize_item(record['dynamodb']['Keys']) record_message[SDC_DELETED_AT] = singer.utils.strftime(record['dynamodb']['ApproximateCreationDateTime']) else: - record_message = deserializer.deserialize_item(record['dynamodb'].get('NewImage')) - if record_message is None: + new_image = record['dynamodb'].get('NewImage') + if new_image is None: LOGGER.fatal('Dynamo stream view type must be either "NEW_IMAGE" "NEW_AND_OLD_IMAGES"') raise RuntimeError('Dynamo stream view type must be either "NEW_IMAGE" "NEW_AND_OLD_IMAGES"') + record_message = deserializer.deserialize_item(new_image) if projection is not None and projection != '': try: record_message = deserializer.apply_projection(record_message, projection)