Skip to content

TST: added test_join_multiindex_dates #44200

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

Closed
wants to merge 2 commits into from
Closed

TST: added test_join_multiindex_dates #44200

wants to merge 2 commits into from

Conversation

zMendes
Copy link

@zMendes zMendes commented Oct 27, 2021

Added tests to make sure that joining dataframes with multiindices containing dates doesn't break.

@@ -323,6 +323,29 @@ def test_join_multiindex_leftright(self):
tm.assert_frame_equal(df1.join(df2, how="right"), exp)
tm.assert_frame_equal(df2.join(df1, how="left"), exp[["value2", "value1"]])

def test_join_multiindex_dates(self):
Copy link
Member

Choose a reason for hiding this comment

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

if 'join' is whats being tested here, can you avoid using groupby and first?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I will change the test

df3 = DataFrame(index=multi_index, columns=["col3"], data=[4])

# if fails, raises error
df1.join([df2, df3])
Copy link
Contributor

Choose a reason for hiding this comment

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

construct the expected frame and use assert_frame_equal

@jreback jreback added Reshaping Concat, Merge/Join, Stack/Unstack, Explode Testing pandas testing functions or related to the test suite labels Oct 27, 2021
@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Nov 27, 2021
@jreback jreback closed this Nov 28, 2021
@jreback
Copy link
Contributor

jreback commented Nov 28, 2021

closing as stale, pls ping if you want to continue working.

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

Successfully merging this pull request may close these issues.

Join several dataframes with MultiIndex containing dates raises ValueError
3 participants