-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: add back check for MultiIndex case and take_split_path #27855
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
This is reverting part of #27351: there was a seemingly unused check removed (as we thought it was for panels), but apparently it was still used (given the regression report in #27841) There was actually discussion about this here: https://github.com/pandas-dev/pandas/pull/10838/files#r302728324 |
Updated. I could simplify the case, and understand now better when this was triggered: it's when adding a single column, but where the single column selection is a slice. In a non-MultiIndex case we actually don't allow this (and you get the same error as now in 0.25 with MultiIndex):
But for the MultiIndex, you can get a "slice" without that the user explicitly slices the columns (as I did for the non-MultiIndex case above). So there we are more flexible. |
Simplification sounds good. If there's a reasonable scope to refactor into its own method, that would be worthwhile; the setitem_with_indexer method is a beast. |
Merged master. I think this is OK to fix the regression. I doubt we would want to backport any simplification code anyway. |
Thanks @jorisvandenbossche |
… and take_split_path
…ev#27855) * BUG: add back check for MultiIndex case and take_split_path * update comment * add simpler test + whatsnew
Closes #27841