Skip to content

how does TypeDeserialization work with DynamoDBStreamEvent #976

Closed Answered by Muthuveerappanv
Muthuveerappanv asked this question in Q&A
Discussion options

You must be logged in to vote

ddb_stream_deserialize.zip

**See if this helps. ☝🏻 **
get_value helps get value of individual attribute. What if I want to transform the entire record.
As highlighted in the example, getting the _data from the object, helps get the dict and from there the deserializer can work, but i wanted to check if that was the intended way from a powertools data model perspective

from_dict = {k: deserializer.deserialize(v) for k, v in record.dynamodb._data["OldImage"].items()}
            print("Works with Dict", from_dict)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@michaelbrewer
Comment options

Answer selected by Muthuveerappanv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants