Skip to content

Commit de07aac

Browse files
committed
fix
1 parent 5484e4a commit de07aac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

flox/core.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2425,6 +2425,9 @@ def groupby_reduce(
24252425
if method == "cohorts" and any_by_dask:
24262426
raise ValueError(f"method={method!r} can only be used when grouping by numpy arrays.")
24272427

2428+
if not is_duck_array(array):
2429+
array = np.asarray(array)
2430+
24282431
reindex = _validate_reindex(
24292432
reindex,
24302433
func,
@@ -2435,8 +2438,6 @@ def groupby_reduce(
24352438
array.dtype,
24362439
)
24372440

2438-
if not is_duck_array(array):
2439-
array = np.asarray(array)
24402441
is_bool_array = np.issubdtype(array.dtype, bool)
24412442
array = array.astype(np.intp) if is_bool_array else array
24422443

0 commit comments

Comments
 (0)