-
-
Notifications
You must be signed in to change notification settings - Fork 150
type freq
in shift
, consistently use Frequency
alias
#1394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
8078382
8e2b00e
83dd9c5
1bfd52a
046e696
7b4194b
6437417
a47ead6
7af641f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,10 +33,10 @@ from pandas.core.series import ( | |
from typing_extensions import Never | ||
|
||
from pandas._libs.tslibs import BaseOffset | ||
from pandas._libs.tslibs.offsets import DateOffset | ||
from pandas._libs.tslibs.period import Period | ||
from pandas._typing import ( | ||
S1, | ||
Frequency, | ||
TimeAmbiguous, | ||
TimeNonexistent, | ||
TimestampConvention, | ||
|
@@ -174,7 +174,7 @@ _DTTimestampTimedeltaReturnType = TypeVar( | |
class _DatetimeRoundingMethods(Generic[_DTTimestampTimedeltaReturnType]): | ||
def round( | ||
self, | ||
freq: str | BaseOffset | None, | ||
freq: Frequency | None, | ||
ambiguous: Literal["raise", "infer", "NaT"] | bool | np_ndarray_bool = ..., | ||
nonexistent: ( | ||
Literal["shift_forward", "shift_backward", "NaT", "raise"] | ||
|
@@ -184,7 +184,7 @@ class _DatetimeRoundingMethods(Generic[_DTTimestampTimedeltaReturnType]): | |
) -> _DTTimestampTimedeltaReturnType: ... | ||
def floor( | ||
self, | ||
freq: str | BaseOffset | None, | ||
freq: Frequency | None, | ||
ambiguous: Literal["raise", "infer", "NaT"] | bool | np_ndarray_bool = ..., | ||
nonexistent: ( | ||
Literal["shift_forward", "shift_backward", "NaT", "raise"] | ||
|
@@ -194,7 +194,7 @@ class _DatetimeRoundingMethods(Generic[_DTTimestampTimedeltaReturnType]): | |
) -> _DTTimestampTimedeltaReturnType: ... | ||
def ceil( | ||
self, | ||
freq: str | BaseOffset | None, | ||
freq: Frequency | None, | ||
ambiguous: Literal["raise", "infer", "NaT"] | bool | np_ndarray_bool = ..., | ||
nonexistent: ( | ||
Literal["shift_forward", "shift_backward", "NaT", "raise"] | ||
|
@@ -220,9 +220,7 @@ class _DatetimeLikeNoTZMethods( | |
_DTToPeriodReturnType, | ||
], | ||
): | ||
def to_period( | ||
self, freq: str | BaseOffset | None = ... | ||
) -> _DTToPeriodReturnType: ... | ||
def to_period(self, freq: Frequency | None = ...) -> _DTToPeriodReturnType: ... | ||
def tz_localize( | ||
self, | ||
tz: TimeZones, | ||
|
@@ -353,12 +351,12 @@ class _PeriodProperties( | |
def strftime(self, date_format: str) -> _PeriodStrReturnTypes: ... | ||
def to_timestamp( | ||
self, | ||
freq: str | DateOffset | None = ..., | ||
freq: Frequency | None = ..., | ||
|
||
how: TimestampConvention = ..., | ||
) -> _PeriodDTAReturnTypes: ... | ||
def asfreq( | ||
self, | ||
freq: str | DateOffset | None = ..., | ||
freq: Frequency | None = ..., | ||
how: Literal["E", "END", "FINISH", "S", "START", "BEGIN"] = ..., | ||
) -> _PeriodPAReturnTypes: ... | ||
|
||
|
@@ -453,7 +451,7 @@ class _dtDescriptor(CombinedDatetimelikeProperties, Generic[S1]): | |
) -> CombinedDatetimelikeProperties: ... | ||
def round( | ||
self, | ||
freq: str | BaseOffset | None, | ||
freq: Frequency | None, | ||
ambiguous: Literal["raise", "infer", "NaT"] | bool | np_ndarray_bool = ..., | ||
nonexistent: ( | ||
Literal["shift_forward", "shift_backward", "NaT", "raise"] | ||
|
@@ -463,7 +461,7 @@ class _dtDescriptor(CombinedDatetimelikeProperties, Generic[S1]): | |
) -> Series[S1]: ... | ||
def floor( | ||
self, | ||
freq: str | BaseOffset | None, | ||
freq: Frequency | None, | ||
ambiguous: Literal["raise", "infer", "NaT"] | bool | np_ndarray_bool = ..., | ||
nonexistent: ( | ||
Literal["shift_forward", "shift_backward", "NaT", "raise"] | ||
|
@@ -473,7 +471,7 @@ class _dtDescriptor(CombinedDatetimelikeProperties, Generic[S1]): | |
) -> Series[S1]: ... | ||
def ceil( | ||
self, | ||
freq: str | BaseOffset | None, | ||
freq: Frequency | None, | ||
ambiguous: Literal["raise", "infer", "NaT"] | bool | np_ndarray_bool = ..., | ||
nonexistent: ( | ||
Literal["shift_forward", "shift_backward", "NaT", "raise"] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs say
str
but offset objects are also accepted, so I think it's ok to keep the current annotation