Skip to content

Commit 4fa9a4c

Browse files
committed
fix
1 parent a5eb7b9 commit 4fa9a4c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

flox/xarray.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,9 @@ def wrapper(array, *by, func, skipna, core_dims, **kwargs):
403403
(newdim,) = quantile_new_dims_func(**finalize_kwargs)
404404
elif func == "topk":
405405
(newdim,) = topk_new_dims_func(**finalize_kwargs)
406-
if not newdim.is_scalar:
406+
else:
407+
newdim = None
408+
if newdim is not None and not newdim.is_scalar:
407409
# NOTE: _restore_dim_order will move any new dims to the end anyway.
408410
# This transpose is simply makes it easy to specify output_core_dims
409411
# output dim order: (*broadcast_dims, *group_dims, quantile_dim)

0 commit comments

Comments
 (0)