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

Raise KeyError when attempting to slice Layout #1295

Merged
merged 3 commits into from Apr 14, 2017
Merged

Raise KeyError when attempting to slice Layout #1295

merged 3 commits into from Apr 14, 2017

Conversation

@philippjfr
Copy link
Member

@philippjfr philippjfr commented Apr 14, 2017

Also snuck a unit test for annotations in here.

@@ -529,6 +529,9 @@ def __getitem__(self, key):
if key < len(self):
return self.data.values()[key]
raise KeyError("Element out of range.")
elif isinstance(key, slice):
raise KeyError("A Layout may not be sliced, ensure that you "
"are slicing on a leaf (i.e. not a branch) of the Layout.")

This comment has been minimized.

@jlstevens

jlstevens Apr 14, 2017
Contributor

maybe 'leaf node' or 'leaf item'?

@jlstevens
Copy link
Contributor

@jlstevens jlstevens commented Apr 14, 2017

Looks good. Happy to merge when the tests pass. And I think that will be it for rc1!

@jlstevens
Copy link
Contributor

@jlstevens jlstevens commented Apr 14, 2017

Merging.

@jlstevens jlstevens merged commit 1b94bfd into master Apr 14, 2017
4 checks passed
4 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.2%) to 78.857%
Details
@philippjfr
s3-reference-data-cache Test data is cached.
Details
@philippjfr philippjfr deleted the small_fixes branch Apr 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants