Skip to content

Commit c3a6d52

Browse files
committed
Set module dunder for group by classes
1 parent 983b577 commit c3a6d52

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
@@ -421,3 +421,5 @@ def test_set_module():
421421
assert pd.date_range.__module__ == "pandas"
422422
assert pd.bdate_range.__module__ == "pandas"
423423
assert pd.NamedAgg.__module__ == "pandas"
424+
assert pd.api.typing.SeriesGroupBy.__module__ == "pandas.api.typing"
425+
assert pd.api.typing.DataFrameGroupBy.__module__ == "pandas.api.typing"

0 commit comments

Comments
 (0)