Description
SeriesGroupBy._cleanup_and_return annotations
def _cleanup_and_return(self, pdf: pd.DataFrame) -> Series: return first_series(pdf).rename().rename(self._psser.name)
are inconsistent:
- If pdf is pd.DataFrame then output should be pd.Series.
- If output is ps.Series then pdf should be ps.DataFrame.
Doesn't seem like the method is used (it is possible that my search skills and PyCharm inspection failed), so I am not sure which of these options was intended.