Skip to content

TST: Test for MultiIndex merge with CategoricalIndex (#36973) #43433

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

tim-tran
Copy link
Contributor

@tim-tran tim-tran commented Sep 6, 2021

@@ -2542,3 +2542,32 @@ def test_mergeerror_on_left_index_mismatched_dtypes():
df_2 = DataFrame(data=["X"], columns=["C"], index=[999])
with pytest.raises(MergeError, match="Can only pass argument"):
merge(df_1, df_2, on=["C"], left_index=True)


def test_multiindex_merge_with_unordered_categoricalindex():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you parametrized over ordered=True/False (test name can stay the same)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you locate this test near other catorical merge tests

test_merge_categorical
tests_merge_categorical_unordered_equal # maybe a dupe of this one

if not a dupe, then ok to add this test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing. It doesn't look like the test is a duplicate

@jreback jreback added Categorical Categorical Data Type Testing pandas testing functions or related to the test suite labels Sep 7, 2021
@tim-tran tim-tran marked this pull request as ready for review September 7, 2021 01:58
@jreback jreback added this to the 1.4 milestone Sep 7, 2021
@jreback jreback added Reshaping Concat, Merge/Join, Stack/Unstack, Explode MultiIndex labels Sep 7, 2021
@jreback jreback merged commit 7556d29 into pandas-dev:master Sep 7, 2021
@jreback
Copy link
Contributor

jreback commented Sep 7, 2021

thanks @tim-tran

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type MultiIndex Reshaping Concat, Merge/Join, Stack/Unstack, Explode Testing pandas testing functions or related to the test suite
Projects
None yet
2 participants