Skip to content

Commit 9d1138c

Browse files
authored
ENH: set __module__ on IndexSlice (#62380)
1 parent e87248e commit 9d1138c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pandas/core/indexing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
LossySetitemError,
2929
)
3030
from pandas.errors.cow import _chained_assignment_msg
31-
from pandas.util._decorators import doc
31+
from pandas.util._decorators import (
32+
doc,
33+
set_module,
34+
)
3235

3336
from pandas.core.dtypes.cast import (
3437
can_hold_element,
@@ -101,6 +104,7 @@
101104

102105

103106
# the public IndexSlicerMaker
107+
@set_module("pandas")
104108
class _IndexSlice:
105109
"""
106110
Create an object to more easily perform multi-index slicing.

pandas/tests/api/test_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,5 +529,6 @@ def test_set_module():
529529
assert pd.to_timedelta.__module__ == "pandas"
530530
assert pd.to_numeric.__module__ == "pandas"
531531
assert pd.NamedAgg.__module__ == "pandas"
532+
assert pd.IndexSlice.__module__ == "pandas"
532533
assert api.typing.SeriesGroupBy.__module__ == "pandas.api.typing"
533534
assert api.typing.DataFrameGroupBy.__module__ == "pandas.api.typing"

0 commit comments

Comments
 (0)