Code Monkey home page Code Monkey logo

tap-dynamodb's Introduction

tap-dynamodb

CircleCI

This is a Singer tap that produces JSON-formatted data following the Singer spec.

Copyright © 2019 Stitch

tap-dynamodb's People

Contributors

asaf-erlich avatar bhtowles avatar cosimon avatar dmosorast avatar dsprayberry avatar kallan357 avatar kspeer825 avatar leslievandemark avatar namrata270998 avatar nick-mccoy avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tap-dynamodb's Issues

Deserialiser incorrectly deserialises empty NewImage Map and throws AttributeError

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'))

which calls

def deserialize_item(self, item):
        return self.deserialize({'M': item})

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"')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.