From f1ba26174349fc53683ab8f9d18983b142e5f046 Mon Sep 17 00:00:00 2001 From: brid-moynihan Date: Tue, 10 Aug 2021 09:44:06 +0100 Subject: [PATCH] Added None check in deserialize.py to avoid the scenario where NewImage is not found on the stream record resulting in an attempt to deserialize the items on NoneType ie. `{'M': None}` now calls as `{'Null':True}` instead. --- tap_dynamodb/deserialize.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tap_dynamodb/deserialize.py b/tap_dynamodb/deserialize.py index f613ab5..1e7a12d 100644 --- a/tap_dynamodb/deserialize.py +++ b/tap_dynamodb/deserialize.py @@ -11,7 +11,13 @@ class Deserializer(TypeDeserializer): ''' def deserialize_item(self, item): - return self.deserialize({'M': item}) + ''' + Deserializes dictionary objects otherwise checks if None and + deserializes to appropriate Pythonic value - None. + ''' + if item is not None: + return self.deserialize({'M': item}) + return self.deserialize({'NULL': True}) def _deserialize_b(self, value): '''