Skip to content

feat(parser): DynamoDBMarshalled helper to parse DynamoDB data structure #3442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

arnabrahman
Copy link
Contributor

Summary

When working with Amazon DynamoDB Stream events, the service sends the DynamoDB items in the database-specific format rather than regular JSON objects.

For example, a string might be represented as { "S": "foo" } rather than just foo. This makes parsing the actual changes within an event hard to parse and validate since it requires customers writing a Zod schema with this in mind.

This PR introduces a helper function DynamoDBMarshalled to work this structure

Changes

  • Helper function to unmarshall and validate dynamoDB stream schema
  • New helper function is exported to a subpath
  • Unit test the new helper function
  • Write up the docs for the new helper function

Issue number: #3194


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.

@boring-cyborg boring-cyborg bot added dependencies Changes that touch dependencies, e.g. Dependabot, etc. documentation Improvements or additions to documentation parser This item relates to the Parser Utility tests PRs that add or change tests labels Dec 23, 2024
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Dec 23, 2024
@arnabrahman arnabrahman marked this pull request as ready for review December 23, 2024 12:23
@arnabrahman arnabrahman requested a review from a team December 23, 2024 12:23
@arnabrahman arnabrahman requested a review from a team as a code owner December 23, 2024 12:23
@dreamorosi
Copy link
Contributor

Hi @arnabrahman - I just got back from my annual leave.

I will review this PR by the end of the week.

Thank you for your patience and happy new year!

@arnabrahman
Copy link
Contributor Author

Hi @dreamorosi , welcome back! I hope you had a refreshing holiday and wish you a happy new year as well.

Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR and for your patience!

I have a minor comment in the signature of the helper so that it's aligned with the underlying unmarshall function, but other than that I am ready to approve the PR.

Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

@dreamorosi
Copy link
Contributor

Just as FYI @arnabrahman - Over the next couple of weeks the team and I will invest time in creating a roadmap and backlog for the next two quarters.

With that, we'll be creating a number of issues and label them accordingly.

@dreamorosi dreamorosi merged commit e154e58 into aws-powertools:main Jan 14, 2025
38 checks passed
@arnabrahman
Copy link
Contributor Author

@dreamorosi Thanks for the update, will be looking forward to it 🚀

@arnabrahman arnabrahman deleted the 3194-dynamodb-parser-helper branch January 14, 2025 11:42
@github-actions github-actions bot added the feature PRs that introduce new features or minor changes label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Changes that touch dependencies, e.g. Dependabot, etc. documentation Improvements or additions to documentation feature PRs that introduce new features or minor changes parser This item relates to the Parser Utility size/L PRs between 100-499 LOC tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants