diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 450ff836b2e..126c3deceb8 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -4271,7 +4271,6 @@ def reduce( keep_attrs: bool = None, keepdims: bool = False, numeric_only: bool = False, - allow_lazy: bool = None, **kwargs: Any, ) -> "Dataset": """Reduce this dataset by applying `func` along some dimension(s). @@ -4346,7 +4345,6 @@ def reduce( dim=reduce_dims, keep_attrs=keep_attrs, keepdims=keepdims, - allow_lazy=allow_lazy, **kwargs, ) diff --git a/xarray/core/variable.py b/xarray/core/variable.py index f4ced459a3a..57dfe3d9091 100644 --- a/xarray/core/variable.py +++ b/xarray/core/variable.py @@ -1582,7 +1582,6 @@ def reduce( axis=None, keep_attrs=None, keepdims=False, - allow_lazy=None, **kwargs, ): """Reduce this array by applying `func` along some dimension(s). @@ -1624,24 +1623,14 @@ def reduce( if dim is not None: axis = self.get_axis_num(dim) - if allow_lazy is not None: - warnings.warn( - "allow_lazy is deprecated and will be removed in version 0.16.0. It is now True by default.", - DeprecationWarning, - ) - else: - allow_lazy = True - - input_data = self.data if allow_lazy else self.values - with warnings.catch_warnings(): warnings.filterwarnings( "ignore", r"Mean of empty slice", category=RuntimeWarning ) if axis is not None: - data = func(input_data, axis=axis, **kwargs) + data = func(self.data, axis=axis, **kwargs) else: - data = func(input_data, **kwargs) + data = func(self.data, **kwargs) if getattr(data, "shape", ()) == self.shape: dims = self.dims diff --git a/xarray/tests/test_variable.py b/xarray/tests/test_variable.py index 08fe0739760..cad565f5255 100644 --- a/xarray/tests/test_variable.py +++ b/xarray/tests/test_variable.py @@ -1570,10 +1570,6 @@ def test_reduce(self): with raises_regex(ValueError, "cannot supply both"): v.mean(dim="x", axis=0) - with pytest.warns(DeprecationWarning, match="allow_lazy is deprecated"): - v.mean(dim="x", allow_lazy=True) - with pytest.warns(DeprecationWarning, match="allow_lazy is deprecated"): - v.mean(dim="x", allow_lazy=False) @pytest.mark.parametrize("skipna", [True, False]) @pytest.mark.parametrize("q", [0.25, [0.50], [0.25, 0.75]])