Skip to content

Commit 462fdc7

Browse files
committed
Bugfix providing aggregation.
I really need a better interface rather than deepcopying the Aggregation instance.
1 parent f20413f commit 462fdc7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flox/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,8 @@ def groupby_reduce(
12381238
except AttributeError:
12391239
raise NotImplementedError(f"Reduction {func!r} not implemented yet")
12401240
else:
1241-
reduction = func
1241+
# TODO: test that func is a valid Aggregation
1242+
reduction = copy.deepcopy(func)
12421243
func = reduction.name
12431244

12441245
reduction.dtype[func] = _normalize_dtype(reduction.dtype[func], array.dtype)

0 commit comments

Comments
 (0)