-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Fix inconsistent ordering between left and right in merge #37406
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
Changes from 2 commits
460d84e
9b298f2
492c756
835c20e
a7153f1
813289c
9c1b0a5
50d69a0
8f7c8d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2283,3 +2283,13 @@ def test_merge_join_categorical_multiindex(): | |
expected = expected.drop(["Cat", "Int"], axis=1) | ||
result = a.join(b, on=["Cat1", "Int1"]) | ||
tm.assert_frame_equal(expected, result) | ||
|
||
|
||
@pytest.mark.parametrize("how", ["left", "right"]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sort=True is ok? (do we test this)? can you locate this test function near similar tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sort True was the previous default behavior. Added tests to show behavior. Moved the tests up a bit right below a nosort test |
||
def test_merge_same_order_left_right(how): | ||
# GH: 35382 | ||
df = DataFrame({"a": [1, 0, 1]}) | ||
|
||
result = df.merge(df, on="a", how=how, sort=False) | ||
expected = DataFrame([1, 1, 0, 1, 1], columns=["a"]) | ||
tm.assert_frame_equal(result, expected) |
Uh oh!
There was an error while loading. Please reload this page.