-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
[ArrowStringArray] API: StringArray -> ObjectStringArray #40962
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
Changes from 3 commits
7cf3a54
f3db92c
836adaa
066711e
e7f2d17
594e383
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 |
---|---|---|
|
@@ -119,7 +119,7 @@ def array( | |
:class:`datetime.timedelta` :class:`pandas.arrays.TimedeltaArray` | ||
:class:`int` :class:`pandas.arrays.IntegerArray` | ||
:class:`float` :class:`pandas.arrays.FloatingArray` | ||
:class:`str` :class:`pandas.arrays.StringArray` | ||
:class:`str` :class:`pandas.arrays.PythonStringArray` | ||
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. there is overlap here with the dtype change. could add the docstring to the baseclass and no need to reference the two array types. |
||
:class:`bool` :class:`pandas.arrays.BooleanArray` | ||
============================== ===================================== | ||
|
||
|
@@ -233,7 +233,7 @@ def array( | |
Length: 2, dtype: Float64 | ||
|
||
>>> pd.array(["a", None, "c"]) | ||
<StringArray> | ||
<PythonStringArray> | ||
['a', <NA>, 'c'] | ||
Length: 3, dtype: string | ||
|
||
|
@@ -290,7 +290,7 @@ def array( | |
IntervalArray, | ||
PandasArray, | ||
PeriodArray, | ||
StringArray, | ||
PythonStringArray, | ||
TimedeltaArray, | ||
) | ||
|
||
|
@@ -333,7 +333,7 @@ def array( | |
return TimedeltaArray._from_sequence(data, copy=copy) | ||
|
||
elif inferred_dtype == "string": | ||
return StringArray._from_sequence(data, copy=copy) | ||
return PythonStringArray._from_sequence(data, copy=copy) | ||
|
||
elif inferred_dtype == "integer": | ||
return IntegerArray._from_sequence(data, copy=copy) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,7 +173,7 @@ def scalar_rep(x): | |
|
||
return self._str_map(scalar_rep, dtype=str) | ||
else: | ||
from pandas.core.arrays.string_ import StringArray | ||
from pandas.core.arrays.string_ import PythonStringArray | ||
from pandas.core.arrays.string_arrow import ArrowStringArray | ||
|
||
def rep(x, r): | ||
|
@@ -186,7 +186,7 @@ def rep(x, r): | |
|
||
repeats = np.asarray(repeats, dtype=object) | ||
result = libops.vec_binop(np.asarray(self), repeats, rep) | ||
if isinstance(self, (StringArray, ArrowStringArray)): | ||
if isinstance(self, (PythonStringArray, ArrowStringArray)): | ||
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. could now use the base class. will change in next commit |
||
# Not going through map, so we have to do this here. | ||
result = type(self)._from_sequence(result) | ||
return result | ||
|
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.
will rename this StringArrayBase in next commit