-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: added test for fixed bug gh#50372 #54701
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
@@ -1252,6 +1252,22 @@ def test_type_error_multiindex(self): | |||
result = dg["x", 0] | |||
tm.assert_series_equal(result, expected) | |||
|
|||
def test_tuple_string_column_names(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.
Can you move this to pandas/tests/indexing/multiindex/test_getitem.py
?
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 @mroeschke
|
||
df_flat = df_flat[[("a", "aa"), "new_single_index"]] | ||
|
||
assert df_flat.columns.equals(Index([("a", "aa"), "new_single_index"])) |
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 construct the full pandas object result of df_flat
and use tm.assert_equal
?
result = df_flat[[("a", "aa"), "new_single_index"]]
expected = ...
tm.assert_equal(result, expected)
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.
Also done (: @mroeschke
Thanks @DRiXD |
I added a test to prevent the bug described in GG#50372 from happening again.