-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
Zip Strict specification for pandas/core/indexes
#62533
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
Conversation
e14857a
to
7b352dc
Compare
pandas/core/indexes/multi.py
Outdated
new_codes = [] | ||
|
||
for lev, level_codes in zip(self.levels, self.codes): | ||
for lev, level_codes in zip(self.levels, self.codes, strict=False): |
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.
What fails when this is True
?
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.
None of the tests are failing for any of the cases flagged. I originally set this to False
, but after some more digging, and I see the MultiIndex constructor enforces the same length for the levels and codes. Setting these to True
pandas/core/indexes/multi.py
Outdated
|
||
changed = False | ||
for lev, level_codes in zip(self.levels, self.codes): | ||
for lev, level_codes in zip(self.levels, self.codes, strict=False): |
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.
What fails when this is True
?
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.
Same as above
pandas/core/indexes/multi.py
Outdated
|
||
retval = [] | ||
for lev, level_codes in zip(self.levels, self.codes): | ||
for lev, level_codes in zip(self.levels, self.codes, strict=False): |
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.
What fails when this is True
?
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.
Same as above
Thanks @krishna-datta |
zip-with-explicit-strict
compliance effort.strict=True