Skip to content
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

fix(util-dynamodb): allow marshall function to handle more input types #3539

Merged
merged 3 commits into from
Apr 22, 2022

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented Apr 13, 2022

Issue

Fixes #2807

@aws-sdk/lib-dynamodb incorrectly marshalls non-object types

Description

  • modify the marshall method in util-dynamodb and used by lib-dynamodb
    • currently this only returns the M property assuming a map is the input
    • I modified this function to return the M or L properties for maps and lists, but otherwise return the converted attributeValue.
  • separately, I believe the function processObj in lib-dynamodb needs to accept falsy values other than undef.

Testing

added unit/integration specs to cover the cases described in the issue and my other change to lib-dynamodb

Additional context

util-dynamodb is an internal package providing the marshaling functionality.
lib-dynamodb is a wrapper for client-dynamodb that aims to simplify the object structure to one that is more JavaScript-like.

@kuhe kuhe requested a review from a team as a code owner April 13, 2022 22:01
@kuhe kuhe added the pr/needs-review This PR needs a review from a Member. label Apr 13, 2022
trivikr
trivikr previously approved these changes Apr 14, 2022
Copy link
Member

@trivikr trivikr left a comment

Choose a reason for hiding this comment

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

Code LGTM, just some comments about move some tests to exists unit tests and using .integ.spec.ts extension for integration tests

packages/util-dynamodb/src/marshall-integ.spec.ts Outdated Show resolved Hide resolved
packages/util-dynamodb/src/marshall-integ.spec.ts Outdated Show resolved Hide resolved
lib/lib-dynamodb/src/commands/utils-integ.spec.ts Outdated Show resolved Hide resolved
@trivikr trivikr self-requested a review April 14, 2022 06:08
@kuhe kuhe force-pushed the 2807-lib-dynamodb-marshal branch from b879c18 to 1105751 Compare April 14, 2022 17:01
@kuhe kuhe requested a review from trivikr April 21, 2022 17:53
@kuhe kuhe merged commit a5fa267 into aws:main Apr 22, 2022
@kuhe kuhe deleted the 2807-lib-dynamodb-marshal branch April 22, 2022 14:53
keithalpichi pushed a commit to keithalpichi/aws-sdk-js-v3 that referenced this pull request Apr 23, 2022
aws#3539)

* fix(util-dynamodb): allow marshall function to handle more input types

* fix(util-dynamodb): revert marshall.spec.ts and minor formatting

* fix(util-dynamodb): code spacing
keithalpichi pushed a commit to keithalpichi/aws-sdk-js-v3 that referenced this pull request Apr 23, 2022
@github-actions
Copy link

github-actions bot commented May 7, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr/needs-review This PR needs a review from a Member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@aws-sdk/lib-dynamodb incorrectly marshalls non-object types
2 participants