File tree 4 files changed +10
-2
lines changed
4 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,8 @@ from pandas._libs.tslibs.offsets import (
115
115
BDay,
116
116
)
117
117
118
+ from pandas.util._decorators import set_module
119
+
118
120
cdef:
119
121
enum :
120
122
INT32_MIN = - 2 _147_483_648LL
@@ -2662,6 +2664,7 @@ cdef class _Period(PeriodMixin):
2662
2664
return period_format(self.ordinal , base , fmt )
2663
2665
2664
2666
2667
+ @set_module("pandas")
2665
2668
class Period(_Period ):
2666
2669
"""
2667
2670
Represents a period of time.
Original file line number Diff line number Diff line change 1
1
import collections
2
2
import warnings
3
3
4
+ from pandas.util._decorators import set_module
4
5
from pandas.util._exceptions import find_stack_level
5
6
6
7
cimport cython
@@ -1771,7 +1772,7 @@ cdef class _Timedelta(timedelta):
1771
1772
1772
1773
# Python front end to C extension type _Timedelta
1773
1774
# This serves as the box for timedelta64
1774
-
1775
+ @ set_module ( " pandas " )
1775
1776
class Timedelta (_Timedelta ):
1776
1777
"""
1777
1778
Represents a duration, the difference between two dates or times.
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ import datetime as dt
50
50
from pandas._libs.tslibs cimport ccalendar
51
51
from pandas._libs.tslibs.base cimport ABCTimestamp
52
52
53
+ from pandas.util._decorators import set_module
53
54
from pandas.util._exceptions import find_stack_level
54
55
55
56
from pandas._libs.tslibs.conversion cimport (
@@ -1263,7 +1264,7 @@ cdef class _Timestamp(ABCTimestamp):
1263
1264
# Python front end to C extension type _Timestamp
1264
1265
# This serves as the box for datetime64
1265
1266
1266
-
1267
+ @ set_module ( " pandas " )
1267
1268
class Timestamp (_Timestamp ):
1268
1269
"""
1269
1270
Pandas replacement for python datetime.datetime object.
Original file line number Diff line number Diff line change @@ -405,3 +405,6 @@ def test_pandas_array_alias():
405
405
406
406
def test_set_module ():
407
407
assert pd .DataFrame .__module__ == "pandas"
408
+ assert pd .Period .__module__ == "pandas"
409
+ assert pd .Timestamp .__module__ == "pandas"
410
+ assert pd .Timedelta .__module__ == "pandas"
You can’t perform that action at this time.
0 commit comments