Skip to content

Commit 7b4194b

Browse files
committed
fixup
1 parent 046e696 commit 7b4194b

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

pandas-stubs/_libs/tslibs/timestamps.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ from typing_extensions import (
3030
)
3131

3232
from pandas._libs.tslibs import (
33-
BaseOffset,
3433
Period,
3534
Tick,
3635
Timedelta,
3736
)
37+
from pandas._libs.tslibs.offsets import DateOffset
3838
from pandas._typing import (
3939
ShapeT,
4040
TimestampNonexistent,
@@ -282,7 +282,7 @@ class Timestamp(datetime, SupportsIndex):
282282
def is_year_end(self) -> bool: ...
283283
def to_pydatetime(self, warn: bool = ...) -> datetime: ...
284284
def to_datetime64(self) -> np.datetime64: ...
285-
def to_period(self, freq: BaseOffset | str | None = ...) -> Period: ...
285+
def to_period(self, freq: DateOffset | str | None = ...) -> Period: ...
286286
def to_julian_date(self) -> np.float64: ...
287287
@property
288288
def asm8(self) -> np.datetime64: ...

pandas-stubs/core/frame.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
16911691
) -> Self: ...
16921692
def to_period(
16931693
self,
1694-
freq: Frequency | None = None,
1694+
freq: str | DateOffset | None = None,
16951695
axis: Axis = 0,
16961696
copy: _bool = True,
16971697
) -> Self: ...

pandas-stubs/core/indexes/accessors.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ class _DatetimeLikeNoTZMethods(
225225
_DTToPeriodReturnType,
226226
],
227227
):
228-
def to_period(self, freq: Frequency | None = ...) -> _DTToPeriodReturnType: ...
228+
def to_period(
229+
self, freq: str | DateOffset | None = ...
230+
) -> _DTToPeriodReturnType: ...
229231
def tz_localize(
230232
self,
231233
tz: TimeZones,

pandas-stubs/core/series.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,9 @@ class Series(IndexOpsMixin[S1], NDFrame):
12411241
how: ToTimestampHow = "start",
12421242
copy: _bool = True,
12431243
) -> Series[S1]: ...
1244-
def to_period(self, freq: _str | None = None, copy: _bool = True) -> DataFrame: ...
1244+
def to_period(
1245+
self, freq: _str | DateOffset | None = None, copy: _bool = True
1246+
) -> DataFrame: ...
12451247
@property
12461248
def str(
12471249
self,

0 commit comments

Comments
 (0)