From 0a4395a2104c59f59f15e476d7968ab4bfef2596 Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Thu, 18 Jul 2024 12:52:40 +0530 Subject: [PATCH] cleanup --- xarray/core/groupers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xarray/core/groupers.py b/xarray/core/groupers.py index c1de4a6e029..4ee500cf960 100644 --- a/xarray/core/groupers.py +++ b/xarray/core/groupers.py @@ -360,8 +360,9 @@ def _get_index_and_items(self) -> tuple[pd.Index, pd.Series, np.ndarray]: def first_items(self) -> tuple[pd.Series, np.ndarray]: from xarray.coding.cftimeindex import CFTimeIndex + from xarray.core.resample_cftime import CFTimeGrouper - if isinstance(self.group_as_index, CFTimeIndex): + if isinstance(self.index_grouper, CFTimeGrouper): return self.index_grouper.first_items( cast(CFTimeIndex, self.group_as_index) )