-
Notifications
You must be signed in to change notification settings - Fork 434
feat(data-classes): replace AttributeValue in DynamoDBStreamEvent with deserialized Python values #1619
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(data-classes): replace AttributeValue in DynamoDBStreamEvent with deserialized Python values #1619
Conversation
aws_lambda_powertools/utilities/data_classes/dynamo_db_stream_event.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
peer review comments in
aws_lambda_powertools/utilities/data_classes/dynamo_db_stream_event.py
Outdated
Show resolved
Hide resolved
aws_lambda_powertools/utilities/data_classes/dynamo_db_stream_event.py
Outdated
Show resolved
Hide resolved
aws_lambda_powertools/utilities/data_classes/dynamo_db_stream_event.py
Outdated
Show resolved
Hide resolved
aws_lambda_powertools/utilities/data_classes/dynamo_db_stream_event.py
Outdated
Show resolved
Hide resolved
aws_lambda_powertools/utilities/data_classes/dynamo_db_stream_event.py
Outdated
Show resolved
Hide resolved
aws_lambda_powertools/utilities/data_classes/dynamo_db_stream_event.py
Outdated
Show resolved
Hide resolved
Codecov ReportBase: 99.40% // Head: 99.36% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## v2 #1619 +/- ##
==========================================
- Coverage 99.40% 99.36% -0.04%
==========================================
Files 127 127
Lines 5842 5815 -27
Branches 367 370 +3
==========================================
- Hits 5807 5778 -29
- Misses 17 18 +1
- Partials 18 19 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |
Issue number: #1432
Summary
Add
DynamoDBImageDeserializer
class to data classes. The class can be used to parse DynamoDB StreamRecord'sold_image
andnew_image
properties of typeDict[str, AttrValue]
to Dict with Python types.Changes
AttributeValue
with deserialized Python types.User experience
Users will be able to convert a StreamRecord's complex image type into a Python dictionary with Python types; without needing to recurse through the data, which was a limitation when using
AttributeValue
.Please note that the following functions:
new_image
,old_image
andkeys
will introduce breaking changes to users.Old usage example:
New usage example:
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
Yes
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.
TODOLIST
AttributeValue
new_image
,old_image
andkeys
are now different from how they used to work previously.