File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 43
43
ensure_platform_int ,
44
44
ensure_uint64 ,
45
45
is_1d_only_ea_dtype ,
46
+ is_string_dtype ,
46
47
)
47
48
from pandas .core .dtypes .missing import (
48
49
isna ,
@@ -959,12 +960,10 @@ def agg_series(
959
960
npvalues = lib .maybe_convert_objects (result , try_float = False )
960
961
961
962
if isinstance (obj ._values , ArrowExtensionArray ):
962
- from pandas .core .dtypes .common import is_string_dtype
963
-
964
963
# When obj.dtype is a string, any object can be cast. Only do so if the
965
964
# UDF returned strings or NA values.
966
- if not is_string_dtype (obj .dtype ) or is_string_dtype (
967
- npvalues [ ~ isna ( npvalues )]
965
+ if not is_string_dtype (obj .dtype ) or lib . is_string_array (
966
+ npvalues , skipna = True
968
967
):
969
968
out = maybe_cast_pointwise_result (
970
969
npvalues , obj .dtype , numeric_only = True , same_dtype = preserve_dtype
You can’t perform that action at this time.
0 commit comments