Skip to content

Commit

Permalink
Fix error handling for incorrectly set up log based streams (#50)
Browse files Browse the repository at this point in the history
Co-authored-by: bryantgrey <[email protected]>
  • Loading branch information
leslievandemark and bryantgray authored Apr 3, 2023
1 parent ad49ea4 commit 0e79742
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions tap_dynamodb/sync_strategies/log_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0e79742

Please sign in to comment.