From 587a05477563c4aedc4b3517c4724fad2f259108 Mon Sep 17 00:00:00 2001 From: Richard Shadrach Date: Fri, 15 Sep 2023 06:38:05 -0400 Subject: [PATCH] fixup --- pandas/core/groupby/groupby.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index cd5dfae9a2efc..c8c16343d1297 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -1970,7 +1970,7 @@ def array_func(values: ArrayLike) -> ArrayLike: # TODO: avoid special casing SparseArray here if how in ["any", "all"] and isinstance(values, SparseArray): pass - if alt is None or how in ["any", "all", "std", "sem"]: + elif alt is None or how in ["any", "all", "std", "sem"]: raise # TODO: re-raise as TypeError? should not be reached else: return result @@ -3337,7 +3337,7 @@ def _idxmin_idxmax( def post_process(res): has_na_value = (res._values == -1).any(axis=None) has_unobserved = not seen.all() - raise_err = not ignore_unobserved and has_unobserved + raise_err: bool | np.bool_ = not ignore_unobserved and has_unobserved if ( not self.observed and not ignore_unobserved