From c210f8b9e3356590ee0d4e25dbb21b93cf7a5309 Mon Sep 17 00:00:00 2001 From: Mathias Hauser Date: Thu, 28 Oct 2021 13:46:03 +0200 Subject: [PATCH] [test-upstream] fix pd skipna=None (#5899) --- xarray/tests/test_duck_array_ops.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xarray/tests/test_duck_array_ops.py b/xarray/tests/test_duck_array_ops.py index 6d49e20909d..c032a781e47 100644 --- a/xarray/tests/test_duck_array_ops.py +++ b/xarray/tests/test_duck_array_ops.py @@ -258,6 +258,11 @@ def from_series_or_scalar(se): def series_reduce(da, func, dim, **kwargs): """convert DataArray to pd.Series, apply pd.func, then convert back to a DataArray. Multiple dims cannot be specified.""" + + # pd no longer accepts skipna=None https://github.com/pandas-dev/pandas/issues/44178 + if kwargs.get("skipna", True) is None: + kwargs["skipna"] = True + if dim is None or da.ndim == 1: se = da.to_series() return from_series_or_scalar(getattr(se, func)(**kwargs))