diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index fe7bf5bbc4c2c..371a185a2e3e6 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -29,7 +29,6 @@ class providing the base-class of operations. Literal, Self, TypeAlias, - TypeVar, Union, cast, final, @@ -969,10 +968,6 @@ def __iter__(self) -> Iterator[tuple[Hashable, NDFrameT]]: return result -# To track operations that expand dimensions, like ohlc -OutputFrameOrSeries = TypeVar("OutputFrameOrSeries", bound=NDFrame) - - class GroupBy(BaseGroupBy[NDFrameT]): """ Class for grouping and aggregating relational data. @@ -1194,9 +1189,7 @@ def _concat_objects( return result.__finalize__(self.obj, method="groupby") @final - def _set_result_index_ordered( - self, result: OutputFrameOrSeries - ) -> OutputFrameOrSeries: + def _set_result_index_ordered(self, result: NDFrameT) -> NDFrameT: # set the result index on the passed values object and # return the new object, xref 8046