You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was an issue recently discovered when trying to set up a DynamoDB integration with Stitch. The stream was incorrectly configured to use ONLY_KEYS, however the error message received by Stitch was
Extraction failed for ‘NoneType’ object has no attribute ‘items'
this itself is a python error message received when the following in log_based.py line 90 is executed: record_message = deserializer.deserialize_item(record['dynamodb'].get('NewImage'))
This makes boto3 TypeDeserializer deserialise a Map value like the following {'M': None} in the following Types.py function
def _deserialize_m(self, value):
return dict([(k, self.deserialize(v)) for k, v in value.items()])
Thus causing the above error message.
To avoid this there should be type checks within the deserialize_item function and an appropriate call to the correct deserialize ie. {'Null': True} for None - since boto3 appears to require: "Value must be a nonempty dictionary whose key is a valid dynamodb type"
This also explains why the following check is never evaluated in log_base.py line 91:
if record_message 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"')
The text was updated successfully, but these errors were encountered:
This was an issue recently discovered when trying to set up a DynamoDB integration with Stitch. The stream was incorrectly configured to use
ONLY_KEYS
, however the error message received by Stitch wasExtraction failed for ‘NoneType’ object has no attribute ‘items'
this itself is a python error message received when the following in
log_based.py
line 90 is executed:record_message = deserializer.deserialize_item(record['dynamodb'].get('NewImage'))
which calls
This makes boto3 TypeDeserializer deserialise a Map value like the following
{'M': None}
in the following Types.py functionThus causing the above error message.
To avoid this there should be type checks within the
deserialize_item
function and an appropriate call to the correct deserialize ie.{'Null': True}
for None - since boto3 appears to require: "Value must be a nonempty dictionary whose key is a valid dynamodb type"This also explains why the following check is never evaluated in
log_base.py
line 91:The text was updated successfully, but these errors were encountered: