Skip to content

Commit 92bd339

Browse files
committed
Set module dunder for group by classes
1 parent 2e8fbdc commit 92bd339

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pandas/core/groupby/generic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ class NamedAgg(NamedTuple):
144144
aggfunc: AggScalar
145145

146146

147+
@set_module("pandas.api.typing")
147148
class SeriesGroupBy(GroupBy[Series]):
148149
def _wrap_agged_manager(self, mgr: Manager) -> Series:
149150
out = self.obj._constructor_from_mgr(mgr, axes=mgr.axes)
@@ -1557,6 +1558,7 @@ def unique(self) -> Series:
15571558
return result
15581559

15591560

1561+
@set_module("pandas.api.typing")
15601562
class DataFrameGroupBy(GroupBy[DataFrame]):
15611563
_agg_examples_doc = dedent(
15621564
"""

pandas/tests/api/test_api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,3 +417,5 @@ def test_set_module():
417417
assert pd.Timestamp.__module__ == "pandas"
418418
assert pd.Timedelta.__module__ == "pandas"
419419
assert pd.NamedAgg.__module__ == "pandas"
420+
assert pd.api.typing.SeriesGroupBy.__module__ == "pandas.api.typing"
421+
assert pd.api.typing.DataFrameGroupBy.__module__ == "pandas.api.typing"

0 commit comments

Comments
 (0)