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 bugs identified in #72, #74, and #75 #73

Merged
merged 10 commits into from
May 21, 2018
Merged

Fix bugs identified in #72, #74, and #75 #73

merged 10 commits into from
May 21, 2018

Conversation

mattsb42-aws
Copy link
Member

Issue #, if available: #72

Description of changes:
Working through mypy integration, I ran across #72. This change fixes that bug and adds a test to cover it.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mattsb42-aws mattsb42-aws requested a review from a team May 16, 2018 20:02
@mattsb42-aws
Copy link
Member Author

Running more testing, I realized that the lock acquisition call was failing on 2.7 (#74). This also fixes that.

@mattsb42-aws
Copy link
Member Author

note: The Travis CI tests will fail until #71 is merged

@mattsb42-aws
Copy link
Member Author

rebased following push of #71

@mattsb42-aws mattsb42-aws changed the title Fix edge case bug in MostRecentProvider lock contention Fix bugs identified in #72, #74, and #75 May 21, 2018
Copy link
Contributor

@lizroth lizroth left a comment

Choose a reason for hiding this comment

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

Looks pretty good, a general question that you've probably already thought about, and possibly a type annotation issue?

@@ -304,7 +304,7 @@ class TableInfo(object):
default=None
)
_secondary_indexes = attr.ib(
validator=attr.validators.optional(iterable_validator(set, TableIndex)),
validator=attr.validators.optional(iterable_validator(list, TableIndex)),
Copy link
Contributor

Choose a reason for hiding this comment

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

What about the type annotation for secondary_indexes on L#341? Did that intentionally not change?

Copy link
Member Author

Choose a reason for hiding this comment

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

nope, that was an oversight

CHANGELOG.rst Outdated
@@ -2,12 +2,30 @@
Changelog
*********

1.0.4 -- 2018-05-xx
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not ideal, but with the travel and everything in play, if you want to put a reasonable date in here I can commit to getting it pushed by then, depending on your thoughts on the rest of the comments.

@@ -378,10 +378,10 @@ def refresh_indexed_attributes(self, client):
table = client.describe_table(TableName=self.name)['Table']
self._primary_index = TableIndex.from_key_schema(table['KeySchema'])

self._secondary_indexes = set()
self._secondary_indexes = []
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there anything that relied on the unordered property of set / anything that will be surprised by order and/or (error-case) duplication being introduced?

I didn't see anything in my quick look but you know the code base best. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

No, we're actually not doing anything with it at all at the moment, it's just being opportunistically collected since it's all in the same API call. I went with the change to list rather than tuple to retain the mutability and the change away from set rather than adding hash capability to TableIndex because I think the later is something that, while it might be useful later, needs more thought if we want to do.

@lizroth lizroth merged commit a5680f0 into aws:master May 21, 2018
@mattsb42-aws mattsb42-aws deleted the fix-72 branch May 22, 2018 17:19
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.

2 participants