diff --git a/pandas/core/groupby/grouper.py b/pandas/core/groupby/grouper.py index fc914831b7a72..4703c12db602d 100644 --- a/pandas/core/groupby/grouper.py +++ b/pandas/core/groupby/grouper.py @@ -330,7 +330,6 @@ def _get_grouper( return grouper, obj - @final def _set_grouper( self, obj: NDFrameT, sort: bool = False, *, gpr_index: Index | None = None ) -> tuple[NDFrameT, Index, npt.NDArray[np.intp] | None]: diff --git a/pandas/core/resample.py b/pandas/core/resample.py index b559d8bfc1a66..3831af23dc16e 100644 --- a/pandas/core/resample.py +++ b/pandas/core/resample.py @@ -49,6 +49,7 @@ ResamplerWindowApply, warn_alias_replacement, ) +from pandas.core.arrays import ArrowExtensionArray from pandas.core.base import ( PandasObject, SelectionMixin, @@ -2500,14 +2501,15 @@ def _get_period_bins(self, ax: PeriodIndex): return binner, bins, labels - @final def _set_grouper( self, obj: NDFrameT, sort: bool = False, *, gpr_index: Index | None = None ) -> tuple[NDFrameT, Index, npt.NDArray[np.intp] | None]: obj, ax, indexer = super()._set_grouper(obj, sort, gpr_index=gpr_index) if isinstance(ax.dtype, ArrowDtype) and ax.dtype.kind in "Mm": self._arrow_dtype = ax.dtype - ax = Index(ax.array._maybe_convert_datelike_array()) + ax = Index( + cast(ArrowExtensionArray, ax.array)._maybe_convert_datelike_array() + ) return obj, ax, indexer