Skip to content

Commit 9265aa7

Browse files
committed
remove SingleConstructorOffset
1 parent 966aebf commit 9265aa7

File tree

2 files changed

+13
-21
lines changed

2 files changed

+13
-21
lines changed

pandas-stubs/_libs/tslibs/offsets.pyi

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,7 @@ class BaseOffset:
8989
@property
9090
def nanos(self) -> int: ...
9191

92-
class SingleConstructorOffset(BaseOffset):
93-
def __reduce__(self): ...
94-
95-
class Tick(SingleConstructorOffset):
92+
class Tick(BaseOffset):
9693
def __init__(self, n: int = ..., normalize: bool = ...) -> None: ...
9794
@property
9895
def nanos(self) -> int: ...
@@ -115,7 +112,7 @@ class BusinessDay(BaseOffset):
115112
) -> None: ...
116113
def __reduce__(self): ...
117114

118-
class BusinessHour(SingleConstructorOffset):
115+
class BusinessHour(BaseOffset):
119116
def __init__(
120117
self,
121118
n: int = ...,
@@ -125,12 +122,12 @@ class BusinessHour(SingleConstructorOffset):
125122
offset: timedelta = ...,
126123
) -> None: ...
127124

128-
class WeekOfMonthMixin(SingleConstructorOffset):
125+
class WeekOfMonthMixin(BaseOffset):
129126
def __init__(
130127
self, n: int = ..., weekday: Literal[0, 1, 2, 3, 4, 5, 6] = ...
131128
) -> None: ...
132129

133-
class YearOffset(SingleConstructorOffset):
130+
class YearOffset(BaseOffset):
134131
def __init__(
135132
self, n: int = ..., normalize: bool = ..., month: int | None = ...
136133
) -> None: ...
@@ -140,7 +137,7 @@ class BYearBegin(YearOffset): ...
140137
class YearEnd(YearOffset): ...
141138
class YearBegin(YearOffset): ...
142139

143-
class QuarterOffset(SingleConstructorOffset):
140+
class QuarterOffset(BaseOffset):
144141
def __init__(
145142
self, n: int = ..., normalize: bool = ..., startingMonth: int | None = ...
146143
) -> None: ...
@@ -149,21 +146,21 @@ class BQuarterEnd(QuarterOffset): ...
149146
class BQuarterBegin(QuarterOffset): ...
150147
class QuarterEnd(QuarterOffset): ...
151148
class QuarterBegin(QuarterOffset): ...
152-
class MonthOffset(SingleConstructorOffset): ...
149+
class MonthOffset(BaseOffset): ...
153150
class MonthEnd(MonthOffset): ...
154151
class MonthBegin(MonthOffset): ...
155152
class BusinessMonthEnd(MonthOffset): ...
156153
class BusinessMonthBegin(MonthOffset): ...
157154

158-
class SemiMonthOffset(SingleConstructorOffset):
155+
class SemiMonthOffset(BaseOffset):
159156
def __init__(
160157
self, n: int = ..., normalize: bool = ..., day_of_month: int | None = ...
161158
) -> None: ...
162159

163160
class SemiMonthEnd(SemiMonthOffset): ...
164161
class SemiMonthBegin(SemiMonthOffset): ...
165162

166-
class Week(SingleConstructorOffset):
163+
class Week(BaseOffset):
167164
def __init__(
168165
self, n: int = ..., normalize: bool = ..., weekday: int | None = ...
169166
) -> None: ...
@@ -175,7 +172,7 @@ class WeekOfMonth(WeekOfMonthMixin):
175172

176173
class LastWeekOfMonth(WeekOfMonthMixin): ...
177174

178-
class FY5253Mixin(SingleConstructorOffset):
175+
class FY5253Mixin(BaseOffset):
179176
def __init__(
180177
self,
181178
n: int = ...,
@@ -187,9 +184,9 @@ class FY5253Mixin(SingleConstructorOffset):
187184

188185
class FY5253(FY5253Mixin): ...
189186
class FY5253Quarter(FY5253Mixin): ...
190-
class Easter(SingleConstructorOffset): ...
187+
class Easter(BaseOffset): ...
191188

192-
class _CustomBusinessMonth(SingleConstructorOffset):
189+
class _CustomBusinessMonth(BaseOffset):
193190
def __init__(
194191
self,
195192
n: int = ...,

pandas-stubs/core/dtypes/dtypes.pyi

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ from pandas.core.series import Series
1010

1111
from pandas._libs import NaTType
1212
from pandas._libs.tslibs import BaseOffset
13-
from pandas._libs.tslibs.offsets import (
14-
RelativeDeltaOffset,
15-
SingleConstructorOffset,
16-
)
1713
from pandas._typing import (
14+
Frequency,
1815
Ordered,
1916
TimeZones,
2017
npt,
@@ -49,9 +46,7 @@ class DatetimeTZDtype(PandasExtensionDtype):
4946
def na_value(self) -> NaTType: ...
5047

5148
class PeriodDtype(PandasExtensionDtype):
52-
def __init__(
53-
self, freq: str | SingleConstructorOffset | RelativeDeltaOffset = ...
54-
) -> None: ...
49+
def __init__(self, freq: Frequency = ...) -> None: ...
5550
@property
5651
def freq(self) -> BaseOffset: ...
5752
@property

0 commit comments

Comments
 (0)