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 handling of binary attr unprocessed #126

Merged
merged 4 commits into from May 12, 2016

Conversation

danielhochman
Copy link
Contributor

@danielhochman danielhochman commented May 11, 2016

fixes #125

  • moved binary attribute handling to its own method and added a test for this specific error case
  • fixed the test for re-batch_writing unprocessed items since it wasn't doing anything before

worth noting that #97 #114 #120 all got it wrong, at least i think #97 did, the approach is a little different

I read the spec and reimplemented correctly http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchWriteItem.html#API_BatchWriteItem_ResponseSyntax

@coveralls
Copy link

coveralls commented May 11, 2016

Coverage Status

Coverage increased (+0.6%) to 97.453% when pulling 919e73f on fix-handling-of-binary-attr-unprocessed into da6aa10 on devel.

@jlafon
Copy link
Contributor

jlafon commented May 11, 2016

It would be nice if we didn't have to 'fix' binary attributes when returned as unprocessed items.

UNPROCESSED_KEYS: {
UserModel.Meta.table_name: batch_items
def test_batch_write_with_unprocessed(self):
items = []

Choose a reason for hiding this comment

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

Looks like you're re-assigning this on line 1816, delete section?

@danielhochman danielhochman merged commit c4f547d into devel May 12, 2016
@danielhochman danielhochman deleted the fix-handling-of-binary-attr-unprocessed branch May 12, 2016 01:59
@danielhochman
Copy link
Contributor Author

binary attributes are double encoded by default unfortunately see #127

it turns out that binary attributes written by the unprocessed items flow were n+2 times encoded, where n is the number of times the item was returned as an unprocessed item from subsequent retries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants