Skip to content

TST add test case for drop_duplicates #35121

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

Merged
merged 5 commits into from
Jul 8, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pandas/tests/frame/methods/test_drop_duplicates.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,3 +425,9 @@ def test_drop_duplicates_null_in_object_column(nulls_fixture):
df = DataFrame([[1, nulls_fixture], [2, "a"]], dtype=object)
result = df.drop_duplicates()
tm.assert_frame_equal(result, df)


def test_drop_duplicates_inplace_result():
df = DataFrame({"a": [1, 2, 3], "b": [1, 2, 4], "c": [1, 6, 5]})
result = df.drop_duplicates(inplace=True)
assert result is None
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 use assert_frame_equal(df, expected) and construct the expected.

ideally this test goes with other basic drop_duplicates call and we parameterize on inplace

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. just checking the return value goes well with the existing
test_drop_duplicates_inplace
moved it there.