-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Some Index
reductions fail with string[pyarrow]
#51397
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
Comments
Hmm, actually this may be more generic than when there's repeated data. I just stumbled across this case where there aren't any repeated items in the index In [1]: import pandas as pd
In [2]: x = pd.Index(['k', 'l', 'i'], dtype='string[python]')
In [3]: x.min()
Out[3]: 'i'
In [4]: x = pd.Index(['k', 'l', 'i'], dtype='string[pyarrow]')
In [5]: x.min()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[5], line 1
----> 1 x.min()
File ~/mambaforge/envs/dask-py39/lib/python3.9/site-packages/pandas/core/indexes/base.py:7225, in Index.min(self, axis, skipna, *args, **kwargs)
7221 return self._na_value
7223 if not self._is_multi and not isinstance(self._values, np.ndarray):
7224 # "ExtensionArray" has no attribute "min"
-> 7225 return self._values.min(skipna=skipna) # type: ignore[attr-defined]
7227 return super().min(skipna=skipna)
AttributeError: 'ArrowStringArray' object has no attribute 'min' |
jrbourbeau
added a commit
to jrbourbeau/dask
that referenced
this issue
Feb 15, 2023
Index
reductions fail with string[pyarrow]
when there is repeated dataIndex
reductions fail with string[pyarrow]
Hi, thx for your report. Yep this is a generic problem. If you have this in a Series, then we are accessing reduction functions through |
5 tasks
j-bennet
pushed a commit
to j-bennet/dask
that referenced
this issue
Feb 17, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
When an
Index
withstring[pyarrow]
data contains repeated data, for examplepd.Index(['a', 'b', 'a'], dtype="string[pyarrow]")
,.min()
/.max()
fail.The above code snippet fails with
Expected Behavior
I'd expect using
string[pyarrow]
data to return the same result asobject
andstring[python]
.cc @phofl @mroeschke
Installed Versions
The text was updated successfully, but these errors were encountered: