-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TYP: index.pyi #40486
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
TYP: index.pyi #40486
Conversation
jbrockmendel
commented
Mar 17, 2021
- closes #xxxx
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jbrockmendel
pandas/core/indexes/multi.py
Outdated
@@ -1111,8 +1112,8 @@ def _engine(self): | |||
# Check the total number of bits needed for our representation: | |||
if lev_bits[0] > 64: | |||
# The levels would overflow a 64 bit uint - use Python integers: | |||
return MultiIndexPyIntEngine(self.levels, self.codes, offsets) | |||
return MultiIndexUIntEngine(self.levels, self.codes, offsets) | |||
return MultiIndexPyIntEngine(list(self.levels), self.codes, offsets) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think should need to change this. should probably be using sequence in BaseMultiIndexCodesEngine.__init__
from https://github.com/python/typeshed/blob/master/CONTRIBUTING.md#conventions
avoid invariant collection types (list, dict) in argument positions, in favor of covariant types like Mapping or Sequence;
Updated+green |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jbrockmendel for the updates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small comment, pls rebase
rebased + greenish |