Skip to content

Commit

Permalink
Ignore overload errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alippai committed Oct 13, 2024
1 parent 1bad029 commit b23d1aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pandas-stubs/_libs/tslibs/offsets.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class BaseOffset:
@overload
def __add__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...
@overload
def __add__(self, other: _DatetimeT) -> _DatetimeT: ...
def __add__(self, other: _DatetimeT) -> _DatetimeT: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __add__(self, other: date) -> Timestamp: ...
@overload
Expand All @@ -53,7 +53,7 @@ class BaseOffset:
@overload
def __radd__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...
@overload
def __radd__(self, other: _DatetimeT) -> _DatetimeT: ...
def __radd__(self, other: _DatetimeT) -> _DatetimeT: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __radd__(self, other: date) -> Timestamp: ...
@overload
Expand All @@ -64,7 +64,7 @@ class BaseOffset:
@overload
def __rsub__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...
@overload
def __rsub__(self, other: _DatetimeT) -> _DatetimeT: ...
def __rsub__(self, other: _DatetimeT) -> _DatetimeT: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __rsub__(self, other: date) -> Timestamp: ...
@overload
Expand Down
3 changes: 3 additions & 0 deletions tests/test_timefuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,9 @@ def test_some_offsets() -> None:
check(assert_type(dt.date.today() - Day(), pd.Timestamp), pd.Timestamp)
check(assert_type(dt.date.today() + Day(), pd.Timestamp), pd.Timestamp)
check(assert_type(Day() + dt.date.today(), pd.Timestamp), pd.Timestamp)
check(assert_type(dt.datetime.now() - Day(), dt.datetime), dt.datetime)
check(assert_type(dt.datetime.now() + Day(), dt.datetime), dt.datetime)
check(assert_type(Day() + dt.datetime.now(), dt.datetime), dt.datetime)
# GH 235
check(
assert_type(
Expand Down

0 comments on commit b23d1aa

Please sign in to comment.