Skip to content

Commit

Permalink
Typing
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke committed Dec 7, 2023
1 parent 222aa32 commit 72d7fb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion pandas/core/groupby/grouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
6 changes: 4 additions & 2 deletions pandas/core/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
ResamplerWindowApply,
warn_alias_replacement,
)
from pandas.core.arrays import ArrowExtensionArray
from pandas.core.base import (
PandasObject,
SelectionMixin,
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 72d7fb0

Please sign in to comment.