Skip to content

Commit 20be463

Browse files
authored
Fix direct quantile reduction (#343)
1 parent 382dc14 commit 20be463

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

flox/xarray.py

+1
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ def xarray_reduce(
312312
# skipna is not supported for all reductions
313313
# https://github.com/pydata/xarray/issues/8819
314314
kwargs = {"skipna": skipna} if skipna is not None else {}
315+
kwargs.update(finalize_kwargs)
315316
result = getattr(ds_broad, func)(dim=dim_tuple, **kwargs)
316317
if isinstance(obj, xr.DataArray):
317318
return obj._from_temp_dataset(result)

tests/test_xarray.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ def test_direct_reduction(func):
736736

737737
data = xr.DataArray(rand, dims=("x", "y"), coords={"x": [10, 20], "y": [0, 1, 2]})
738738
with xr.set_options(use_flox=True):
739-
actual = getattr(data.groupby("x", squeeze=False), func)(**kwargs)
739+
actual = xarray_reduce(data, "x", func=func, **kwargs)
740740
with xr.set_options(use_flox=False):
741741
expected = getattr(data.groupby("x", squeeze=False), func)(**kwargs)
742742
xr.testing.assert_identical(expected, actual)

0 commit comments

Comments
 (0)