Skip to content

Commit

Permalink
OffsetSeries inherits from Series[BaseOffset] (#844)
Browse files Browse the repository at this point in the history
  • Loading branch information
twoertwein committed Dec 26, 2023
1 parent 72b22b5 commit 146cf23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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 @@ -2137,7 +2137,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

0 comments on commit 146cf23

Please sign in to comment.