File tree 2 files changed +7
-2
lines changed 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -360,7 +360,10 @@ def agg_list_like(self) -> FrameOrSeriesUnion:
360
360
# raised directly in _aggregate_named
361
361
pass
362
362
elif "no results" in str (err ):
363
- # raised directly in _aggregate_multiple_funcs
363
+ # reached in test_frame_apply.test_nuiscance_columns
364
+ # where the colg.aggregate(arg) ends up going through
365
+ # the selected_obj.ndim == 1 branch above with arg == ["sum"]
366
+ # on a datetime64[ns] column
364
367
pass
365
368
else :
366
369
raise
Original file line number Diff line number Diff line change @@ -1110,6 +1110,7 @@ def _cython_agg_general(
1110
1110
# Note: we never get here with how="ohlc"; that goes through SeriesGroupBy
1111
1111
1112
1112
data : Manager2D = self ._get_data_to_aggregate ()
1113
+ orig = data
1113
1114
1114
1115
if numeric_only :
1115
1116
data = data .get_numeric_data (copy = False )
@@ -1187,7 +1188,8 @@ def array_func(values: ArrayLike) -> ArrayLike:
1187
1188
# continue and exclude the block
1188
1189
new_mgr = data .grouped_reduce (array_func , ignore_failures = True )
1189
1190
1190
- if not len (new_mgr ):
1191
+ if not len (new_mgr ) and len (orig ):
1192
+ # If the original Manager was already empty, no need to raise
1191
1193
raise DataError ("No numeric types to aggregate" )
1192
1194
1193
1195
return self ._wrap_agged_manager (new_mgr )
You can’t perform that action at this time.
0 commit comments