-
-
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
BUG: value_counts() check Index with PyArrow categorical columns #60569
base: main
Are you sure you want to change the base?
Conversation
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! Will need to add tests using the value_counts
method too. The CI appears to be failing, I'd recommend merging main and see if it's still failing.
@@ -447,7 +447,10 @@ def __init__( | |||
if isinstance(values.dtype, ArrowDtype) and issubclass( | |||
values.dtype.type, CategoricalDtypeType | |||
): | |||
arr = values._pa_array.combine_chunks() | |||
if values.__class__.__name__ == 'Index': |
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.
Use isinstance
instead of checking the name.
values = Index(["a1", "a2"], dtype=ArrowDtype(pa.string())) | ||
arr = values._data._pa_array.combine_chunks() | ||
|
||
assert arr.equals(values._data._pa_array.combine_chunks()) |
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.
What is this testing?
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.This is my first issue, thank you in advance for your patience and feedback!