Skip to content

Commit

Permalink
[test-upstream] fix pd skipna=None (#5899)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathause authored Oct 28, 2021
1 parent b3b77f5 commit c210f8b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xarray/tests/test_duck_array_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit c210f8b

Please sign in to comment.