We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 641427e commit ddff592Copy full SHA for ddff592
pandas/core/groupby/ops.py
@@ -52,6 +52,7 @@
52
maybe_fill,
53
)
54
55
+import pandas as pd
56
from pandas.core.frame import DataFrame
57
from pandas.core.groupby import grouper
58
from pandas.core.indexes.api import (
@@ -837,7 +838,11 @@ def agg_series(
837
838
# test_groupby_empty_with_category gets here with self.ngroups == 0
839
# and len(obj) > 0
840
- if len(obj) > 0 and not isinstance(obj._values, np.ndarray):
841
+ if (
842
+ len(obj) > 0
843
+ and not isinstance(obj._values, np.ndarray)
844
+ and not isinstance(obj._values, pd.arrays.ArrowExtensionArray)
845
+ ):
846
# we can preserve a little bit more aggressively with EA dtype
847
# because maybe_cast_pointwise_result will do a try/except
848
# with _from_sequence. NB we are assuming here that _from_sequence
0 commit comments