Skip to content

remove several internal-only methods from offsets.pyi #1163

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

Merged
merged 1 commit into from
May 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions pandas-stubs/_libs/tslibs/offsets.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ from pandas.tseries.holiday import AbstractHolidayCalendar
_DatetimeT = TypeVar("_DatetimeT", bound=datetime)
_TimedeltaT = TypeVar("_TimedeltaT", bound=timedelta)

prefix_mapping: dict[str, type]

class ApplyTypeError(TypeError): ...

class BaseOffset:
Expand Down Expand Up @@ -96,9 +94,6 @@ class BaseOffset:
def __getstate__(self): ...
@property
def nanos(self) -> int: ...
def onOffset(self, dt: datetime) -> bool: ...
def isAnchored(self) -> bool: ...
def is_anchored(self) -> bool: ...

class SingleConstructorOffset(BaseOffset):
def __reduce__(self): ...
Expand All @@ -110,8 +105,6 @@ class Tick(SingleConstructorOffset):
@property
def nanos(self) -> int: ...

def delta_to_tick(delta: timedelta) -> Tick: ...

class Day(Tick): ...
class Hour(Tick): ...
class Minute(Tick): ...
Expand All @@ -123,19 +116,14 @@ class Nano(Tick): ...
class RelativeDeltaOffset(BaseOffset):
def __init__(self, n: int = ..., normalize: bool = ..., **kwds: Any) -> None: ...

class BusinessMixin(SingleConstructorOffset):
def __init__(
self, n: int = ..., normalize: bool = ..., offset: timedelta = ...
) -> None: ...

# Changed from implementation because it is not allowed for `PeriodDtype`
class BusinessDay(BaseOffset):
def __init__(
self, n: int = ..., normalize: bool = ..., offset: timedelta = ...
) -> None: ...
def __reduce__(self): ...

class BusinessHour(BusinessMixin):
class BusinessHour(SingleConstructorOffset):
def __init__(
self,
n: int = ...,
Expand Down Expand Up @@ -209,7 +197,7 @@ class FY5253(FY5253Mixin): ...
class FY5253Quarter(FY5253Mixin): ...
class Easter(SingleConstructorOffset): ...

class _CustomBusinessMonth(BusinessMixin):
class _CustomBusinessMonth(SingleConstructorOffset):
def __init__(
self,
n: int = ...,
Expand Down Expand Up @@ -274,10 +262,3 @@ BMonthBegin = BusinessMonthBegin
CBMonthEnd = CustomBusinessMonthEnd
CBMonthBegin = CustomBusinessMonthBegin
CDay = CustomBusinessDay

def roll_qtrday(
other: datetime, n: int, month: int, day_opt: str, modby: int
) -> int: ...
def shift_months(
dtindex: npt.NDArray[np.int64], months: int, day_opt: str | None = ...
) -> npt.NDArray[np.int64]: ...