-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix regression for loc and __setitem__ when one-dimensional tuple was given for MultiIndex #37787
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
… given for MultiIndex
@@ -288,6 +288,20 @@ def convert_nested_indexer(indexer_type, keys): | |||
|
|||
tm.assert_series_equal(result, expected) | |||
|
|||
def test_multiindex_loc_one_dimensional_tuple(self): |
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.
use frame_or_series
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.
Done
@phofl you're opening PRs faster than they can be reviewed (which is awesome, keep up the good work!). Maybe you can tackle one of the more challenging and immediate issues: the darns windows builds |
Thank you very much @jbrockmendel Have a bit of free time this week. Are you referring to the pipeline windows py38_no18? Unfortunately I am not that familiar with CI and even less with CI on windows. |
� Conflicts: � doc/source/whatsnew/v1.1.5.rst
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.
tiny comment, ping on green.
@@ -288,6 +288,14 @@ def convert_nested_indexer(indexer_type, keys): | |||
|
|||
tm.assert_series_equal(result, expected) | |||
|
|||
def test_multiindex_loc_one_dimensional_tuple(self, frame_or_series): |
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.
can you parameterize over all of the selectors in the OP e.g. obj.loc[('a',), :]
if its a DataFrame
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.
Added tests for df, I think one of the cases mentioned there should raise and not work
tm.assert_equal(obj, expected) | ||
|
||
@pytest.mark.parametrize("indexer", [("a",), ("a")]) | ||
def test_multiindex_one_dimensiona_tuple_columns(self, indexer): |
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.
typo dimensional?
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.
Yep, thx. Fixed
lgtm ex @jbrockmendel comment, ping on green. |
� Conflicts: � doc/source/whatsnew/v1.1.5.rst
thanks @phofl keep em coming! |
@meeseeksdev backport 1.1.x |
…when one-dimensional tuple was given for MultiIndex
CI is just another learning curve we all have to get up at some point. i still regularly ask for help with it. As for windows, im not actually convinced anyone uses it ever. It might be some kind of cruel prank played by a trickster god. see #37746 where i only-half-kidding suggest we drop windows altogether. More generally, I'm suggesting you look for areas that will have a higher ratio of (time to create PR) / (time to review PR).* * Though im really excited about the indexing fixes you've been making. |
… given for MultiIndex (pandas-dev#37787) (cherry picked from commit b80691c)
…tem__ when one-dimensional tuple was given for MultiIndex) (#37849)
.loc[(slice(...), ), ]
when modifying a subset of rows in a pandas dataframe/series in 1.1.4 #37711black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff