@@ -33,10 +33,10 @@ from pandas.core.series import (
33
33
from typing_extensions import Never
34
34
35
35
from pandas ._libs .tslibs import BaseOffset
36
- from pandas ._libs .tslibs .offsets import DateOffset
37
36
from pandas ._libs .tslibs .period import Period
38
37
from pandas ._typing import (
39
38
S1 ,
39
+ Frequency ,
40
40
TimeAmbiguous ,
41
41
TimeNonexistent ,
42
42
TimestampConvention ,
@@ -174,7 +174,7 @@ _DTTimestampTimedeltaReturnType = TypeVar(
174
174
class _DatetimeRoundingMethods (Generic [_DTTimestampTimedeltaReturnType ]):
175
175
def round (
176
176
self ,
177
- freq : str | BaseOffset | None ,
177
+ freq : Frequency | None ,
178
178
ambiguous : Literal ["raise" , "infer" , "NaT" ] | bool | np_ndarray_bool = ...,
179
179
nonexistent : (
180
180
Literal ["shift_forward" , "shift_backward" , "NaT" , "raise" ]
@@ -184,7 +184,7 @@ class _DatetimeRoundingMethods(Generic[_DTTimestampTimedeltaReturnType]):
184
184
) -> _DTTimestampTimedeltaReturnType : ...
185
185
def floor (
186
186
self ,
187
- freq : str | BaseOffset | None ,
187
+ freq : Frequency | None ,
188
188
ambiguous : Literal ["raise" , "infer" , "NaT" ] | bool | np_ndarray_bool = ...,
189
189
nonexistent : (
190
190
Literal ["shift_forward" , "shift_backward" , "NaT" , "raise" ]
@@ -194,7 +194,7 @@ class _DatetimeRoundingMethods(Generic[_DTTimestampTimedeltaReturnType]):
194
194
) -> _DTTimestampTimedeltaReturnType : ...
195
195
def ceil (
196
196
self ,
197
- freq : str | BaseOffset | None ,
197
+ freq : Frequency | None ,
198
198
ambiguous : Literal ["raise" , "infer" , "NaT" ] | bool | np_ndarray_bool = ...,
199
199
nonexistent : (
200
200
Literal ["shift_forward" , "shift_backward" , "NaT" , "raise" ]
@@ -220,9 +220,7 @@ class _DatetimeLikeNoTZMethods(
220
220
_DTToPeriodReturnType ,
221
221
],
222
222
):
223
- def to_period (
224
- self , freq : str | BaseOffset | None = ...
225
- ) -> _DTToPeriodReturnType : ...
223
+ def to_period (self , freq : Frequency | None = ...) -> _DTToPeriodReturnType : ...
226
224
def tz_localize (
227
225
self ,
228
226
tz : TimeZones ,
@@ -353,12 +351,12 @@ class _PeriodProperties(
353
351
def strftime (self , date_format : str ) -> _PeriodStrReturnTypes : ...
354
352
def to_timestamp (
355
353
self ,
356
- freq : str | DateOffset | None = ...,
354
+ freq : Frequency | None = ...,
357
355
how : TimestampConvention = ...,
358
356
) -> _PeriodDTAReturnTypes : ...
359
357
def asfreq (
360
358
self ,
361
- freq : str | DateOffset | None = ...,
359
+ freq : Frequency | None = ...,
362
360
how : Literal ["E" , "END" , "FINISH" , "S" , "START" , "BEGIN" ] = ...,
363
361
) -> _PeriodPAReturnTypes : ...
364
362
@@ -453,7 +451,7 @@ class _dtDescriptor(CombinedDatetimelikeProperties, Generic[S1]):
453
451
) -> CombinedDatetimelikeProperties : ...
454
452
def round (
455
453
self ,
456
- freq : str | BaseOffset | None ,
454
+ freq : Frequency | None ,
457
455
ambiguous : Literal ["raise" , "infer" , "NaT" ] | bool | np_ndarray_bool = ...,
458
456
nonexistent : (
459
457
Literal ["shift_forward" , "shift_backward" , "NaT" , "raise" ]
@@ -463,7 +461,7 @@ class _dtDescriptor(CombinedDatetimelikeProperties, Generic[S1]):
463
461
) -> Series [S1 ]: ...
464
462
def floor (
465
463
self ,
466
- freq : str | BaseOffset | None ,
464
+ freq : Frequency | None ,
467
465
ambiguous : Literal ["raise" , "infer" , "NaT" ] | bool | np_ndarray_bool = ...,
468
466
nonexistent : (
469
467
Literal ["shift_forward" , "shift_backward" , "NaT" , "raise" ]
@@ -473,7 +471,7 @@ class _dtDescriptor(CombinedDatetimelikeProperties, Generic[S1]):
473
471
) -> Series [S1 ]: ...
474
472
def ceil (
475
473
self ,
476
- freq : str | BaseOffset | None ,
474
+ freq : Frequency | None ,
477
475
ambiguous : Literal ["raise" , "infer" , "NaT" ] | bool | np_ndarray_bool = ...,
478
476
nonexistent : (
479
477
Literal ["shift_forward" , "shift_backward" , "NaT" , "raise" ]
0 commit comments