Skip to content

Commit e9f7fb4

Browse files
twoertweinyehoshuadimarsky
authored andcommitted
CI/TYP: require mypy error-codes in ignore comments (pandas-dev#46424)
1 parent 6ce8bb4 commit e9f7fb4

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pandas/_libs/tslibs/timestamps.pyi

+5-5
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ class Timestamp(datetime):
133133
def utcoffset(self) -> timedelta | None: ...
134134
def tzname(self) -> str | None: ...
135135
def dst(self) -> timedelta | None: ...
136-
def __le__(self, other: datetime) -> bool: ... # type: ignore
137-
def __lt__(self, other: datetime) -> bool: ... # type: ignore
138-
def __ge__(self, other: datetime) -> bool: ... # type: ignore
139-
def __gt__(self, other: datetime) -> bool: ... # type: ignore
136+
def __le__(self, other: datetime) -> bool: ... # type: ignore[override]
137+
def __lt__(self, other: datetime) -> bool: ... # type: ignore[override]
138+
def __ge__(self, other: datetime) -> bool: ... # type: ignore[override]
139+
def __gt__(self, other: datetime) -> bool: ... # type: ignore[override]
140140
# error: Signature of "__add__" incompatible with supertype "date"/"datetime"
141141
@overload # type: ignore[override]
142142
def __add__(self, other: np.ndarray) -> np.ndarray: ...
@@ -145,7 +145,7 @@ class Timestamp(datetime):
145145
self: _DatetimeT, other: timedelta | np.timedelta64 | Tick
146146
) -> _DatetimeT: ...
147147
def __radd__(self: _DatetimeT, other: timedelta) -> _DatetimeT: ...
148-
@overload # type: ignore
148+
@overload # type: ignore[override]
149149
def __sub__(self, other: datetime) -> Timedelta: ...
150150
@overload
151151
def __sub__(

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ warn_unreachable = false # GH#27396
9797
# Suppressing errors
9898
show_none_errors = true
9999
ignore_errors = false
100+
enable_error_code = "ignore-without-code"
100101
# Miscellaneous strictness flags
101102
allow_untyped_globals = false
102103
allow_redefinition = false

0 commit comments

Comments
 (0)