Repository navigation
how does TypeDeserialization work with DynamoDBStreamEvent #976
|
Trying to de-serialize dynamodb stream event in lambda, when using the below, number types get transformed to string so tried using type deserializer from boto3, but below didn't work as v is a object and not a dict What worked - was passing the Is there a way to derserialize the |
Replies: 2 comments 1 reply
|
@Muthuveerappanv would it be possible to post a more complete example with an event, so i can reproduce your issue and see if we can make a fix for it or use the existing api to do what you want. Otherwise |
|
**See if this helps. ☝🏻 ** from_dict = {k: deserializer.deserialize(v) for k, v in record.dynamodb._data["OldImage"].items()}
print("Works with Dict", from_dict) |
ddb_stream_deserialize.zip
**See if this helps. ☝🏻 **
get_valuehelps 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