-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
BUG: pd.unique(Index) now returns Index as Index.unique #57679
Conversation
Looks like CI failures are not related. Could you please review this PR? @rhshadrach |
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.
Thanks for the PR! Some questions / requests.
pandas/tests/test_algos.py
Outdated
# GH#57043 | ||
index = index.repeat(2) | ||
result = algos.unique(index) | ||
expected = index.unique() |
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.
Is it doable to specify expected
explicitly here instead of using index.unique()
?
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.
I think we can adapt the test from
pandas/pandas/tests/base/test_unique.py
Line 12 in 4692686
def test_unique(index_or_series_obj): |
Thank you for the review. I push a new commit to address the requests. @rhshadrach |
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.
lgtm, wouldn't mind another eye @mroeschke
Thanks @yuanx749 |
…7679) * Add test * Fix * Adjust tests * Add whatsnew * Improve tests * Remove duplicate test
Some old tests are adjusted for consistency.
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.