From d535a3bf46ec26e3857bd0a350120107bb9a2199 Mon Sep 17 00:00:00 2001 From: Illviljan <14371165+Illviljan@users.noreply.github.com> Date: Sun, 13 Mar 2022 05:21:54 +0100 Subject: [PATCH] Run pyupgrade on core/groupby (#6351) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- xarray/core/groupby.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py index dea8949b84f..68db14c29be 100644 --- a/xarray/core/groupby.py +++ b/xarray/core/groupby.py @@ -1,6 +1,8 @@ +from __future__ import annotations + import datetime import warnings -from typing import Any, Callable, Hashable, Sequence, Union +from typing import Any, Callable, Hashable, Sequence import numpy as np import pandas as pd @@ -869,9 +871,9 @@ def _combine(self, applied, shortcut=False): def reduce( self, func: Callable[..., Any], - dim: Union[None, Hashable, Sequence[Hashable]] = None, + dim: None | Hashable | Sequence[Hashable] = None, *, - axis: Union[None, int, Sequence[int]] = None, + axis: None | int | Sequence[int] = None, keep_attrs: bool = None, keepdims: bool = False, shortcut: bool = True, @@ -997,9 +999,9 @@ def _combine(self, applied): def reduce( self, func: Callable[..., Any], - dim: Union[None, Hashable, Sequence[Hashable]] = None, + dim: None | Hashable | Sequence[Hashable] = None, *, - axis: Union[None, int, Sequence[int]] = None, + axis: None | int | Sequence[int] = None, keep_attrs: bool = None, keepdims: bool = False, **kwargs: Any,