Skip to content
forked from pydata/xarray

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Niklas  <mick.niklas@gmail.com>
  • Loading branch information
dcherian and headtr1ck committed Jan 3, 2024
1 parent dd6ea53 commit d13fa0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xarray/core/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def group_as_index(self) -> pd.Index:
return self._group_as_index

@property
def can_squeeze(self):
def can_squeeze(self) -> bool:
is_dimension = self.group.dims == (self.group.name,)
return is_dimension and self.is_unique_and_monotonic

Expand Down Expand Up @@ -619,7 +619,7 @@ def _validate_groupby_squeeze(squeeze: bool | None) -> None:
# A future version could make squeeze kwarg only, but would face
# backward-compat issues.
if squeeze is not None and not isinstance(squeeze, bool):
raise TypeError(f"`squeeze` must be True or False, but {squeeze} was supplied")
raise TypeError(f"`squeeze` must be None, True or False, but {squeeze} was supplied")


def _resolve_group(obj: T_Xarray, group: T_Group | Hashable) -> T_Group:
Expand Down

0 comments on commit d13fa0e

Please sign in to comment.