Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions flox/xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ def xarray_reduce(
# skipna is not supported for all reductions
# https://github.com/pydata/xarray/issues/8819
kwargs = {"skipna": skipna} if skipna is not None else {}
kwargs.update(finalize_kwargs)
result = getattr(ds_broad, func)(dim=dim_tuple, **kwargs)
if isinstance(obj, xr.DataArray):
return obj._from_temp_dataset(result)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ def test_direct_reduction(func):

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