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 4343 ensure_platform_int ,
4444 ensure_uint64 ,
4545 is_1d_only_ea_dtype ,
46+ is_string_dtype ,
4647)
4748from pandas .core .dtypes .missing import (
4849 isna ,
@@ -959,12 +960,10 @@ def agg_series(
959960 npvalues = lib .maybe_convert_objects (result , try_float = False )
960961
961962 if isinstance (obj ._values , ArrowExtensionArray ):
962- from pandas .core .dtypes .common import is_string_dtype
963-
964963 # When obj.dtype is a string, any object can be cast. Only do so if the
965964 # 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
968967 ):
969968 out = maybe_cast_pointwise_result (
970969 npvalues , obj .dtype , numeric_only = True , same_dtype = preserve_dtype
You can’t perform that action at this time.
0 commit comments