-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Deprecated Index.get_duplicates() #20544
Changes from 7 commits
675af54
024810f
ed58eec
a1c5e51
09d4f94
958388e
76c9a43
94376e4
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 |
---|---|---|
|
@@ -2413,7 +2413,12 @@ def check(nlevels, with_nulls): | |
for a in [101, 102]: | ||
mi = MultiIndex.from_arrays([[101, a], [3.5, np.nan]]) | ||
assert not mi.has_duplicates | ||
assert mi.get_duplicates() == [] | ||
|
||
with warnings.catch_warnings(record=True): | ||
# Deprecated - see GH20239 | ||
assert mi.get_duplicates().equals(MultiIndex.from_arrays( | ||
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. Had to tweak the assertion here given the return value is no longer a list, though I assume you are aware of that from the original issue. With that said, this is a different behavior for non-datetimelikes (which were returning a like-Index object) - is it worth documenting that in the whatsnew or is this getting into too technical of a distinction? 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. this is fine |
||
[[], []])) | ||
|
||
tm.assert_numpy_array_equal(mi.duplicated(), np.zeros( | ||
2, dtype='bool')) | ||
|
||
|
@@ -2425,7 +2430,12 @@ def check(nlevels, with_nulls): | |
labels=np.random.permutation(list(lab)).T) | ||
assert len(mi) == (n + 1) * (m + 1) | ||
assert not mi.has_duplicates | ||
assert mi.get_duplicates() == [] | ||
|
||
with warnings.catch_warnings(record=True): | ||
# Deprecated - see GH20239 | ||
assert mi.get_duplicates().equals(MultiIndex.from_arrays( | ||
[[], []])) | ||
|
||
tm.assert_numpy_array_equal(mi.duplicated(), np.zeros( | ||
len(mi), dtype='bool')) | ||
|
||
|
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.
need to remove the usage from all tests or catch the warnings