Skip to content

OffsetSeries inherits from Series[BaseOffset] #844

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
Dec 26, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion pandas-stubs/_typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ from typing_extensions import TypeAlias

from pandas._libs.interval import Interval
from pandas._libs.tslibs import (
BaseOffset,
Period,
Timedelta,
Timestamp,
Expand Down Expand Up @@ -527,7 +528,8 @@ S1 = TypeVar(
| datetime.timedelta # includes pd.Timedelta
| Period
| Interval
| CategoricalDtype,
| CategoricalDtype
| BaseOffset,
)

IndexingInt: TypeAlias = (
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2127,7 +2127,7 @@ class PeriodSeries(Series[Period]):
def dt(self) -> PeriodProperties: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
def __sub__(self, other: PeriodSeries) -> OffsetSeries: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]

class OffsetSeries(Series):
class OffsetSeries(Series[BaseOffset]):
@overload # type: ignore[override]
def __radd__(self, other: Period) -> PeriodSeries: ...
@overload
Expand Down