Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
not what i meant
can u eliminate this branch here
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.
@jreback
Ok. I eliminate branch. But I don't know how not to use branch and not conflict with test cases together. Could you give me a clue?
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.
@jreback i think the blocker here is clarifying for this contributor what you're asking for
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 CI logs are around but do we know why this change fails CI? I think @jreback point is that this seems unnecessary so unclear why it is causing the failures
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.
@WillAyd
Because "Index.take"
cause fail.
Some Indexes use ".take" from "Index.take". If
grouper = level_index.take(codes, fill_value=True)
all the time and "level_index" use "take" from "Index.take", then raise exception.So I changed check "level_index" empty or not. this check avoids from exception.
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.
Hmm OK. I guess that goes back to this line:
pandas/pandas/core/indexes/base.py
Line 804 in 2470690
So I guess we would have to allow
fill_value
being passed to Index types that can't hold NA for this to work.I think I'd be OK with that but any objections @jreback?
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.
@WillAyd
You are right. If Some level index in "MultiIndex", which can't hold NA do not pass
flll_value
. can exist. So there is need to check.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.
@proost I think you can replace the
if
check to beif level_index._can_hold_na
: to at least be more explicit