Skip to content

Commit 0b46778

Browse files
authored
Enable reportUnnecessaryTypeIgnoreComment (pandas-dev#487)
* Enable reportUnnecessaryTypeIgnoreComment * fix comments
1 parent ab1de1f commit 0b46778

15 files changed

+77
-93
lines changed

pandas-stubs/_libs/interval.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,15 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
193193
@overload
194194
def __le__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_ndarray_bool: ...
195195
@overload
196-
def __eq__(self, other: Interval[_OrderableT]) -> bool: ... # type: ignore[misc]
196+
def __eq__(self, other: Interval[_OrderableT]) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
197197
@overload
198198
def __eq__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_ndarray_bool: ... # type: ignore[misc]
199199
@overload
200200
def __eq__(self, other: Series[_OrderableT]) -> Series[bool]: ... # type: ignore[misc]
201201
@overload
202202
def __eq__(self, other: object) -> Literal[False]: ...
203203
@overload
204-
def __ne__(self, other: Interval[_OrderableT]) -> bool: ... # type: ignore[misc]
204+
def __ne__(self, other: Interval[_OrderableT]) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
205205
@overload
206206
def __ne__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_ndarray_bool: ... # type: ignore[misc]
207207
@overload

pandas-stubs/_libs/tslibs/period.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class Period(PeriodMixin):
9797
# ignore[misc] here because we know all other comparisons
9898
# are False, so we use Literal[False]
9999
@overload
100-
def __eq__(self, other: Period) -> bool: ... # type: ignore[misc]
100+
def __eq__(self, other: Period) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
101101
@overload
102102
def __eq__(self, other: PeriodIndex) -> npt.NDArray[np.bool_]: ... # type: ignore[misc]
103103
@overload
@@ -131,7 +131,7 @@ class Period(PeriodMixin):
131131
# ignore[misc] here because we know all other comparisons
132132
# are False, so we use Literal[False]
133133
@overload
134-
def __ne__(self, other: Period) -> bool: ... # type: ignore[misc]
134+
def __ne__(self, other: Period) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
135135
@overload
136136
def __ne__(self, other: PeriodIndex) -> npt.NDArray[np.bool_]: ... # type: ignore[misc]
137137
@overload

pandas-stubs/_libs/tslibs/timedeltas.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class Timedelta(timedelta):
312312
def __rtruediv__(self, other: timedelta | Timedelta | NaTType) -> float: ...
313313
# Override due to more types supported than dt.timedelta
314314
@overload
315-
def __eq__(self, other: timedelta | Timedelta | np.timedelta64) -> bool: ... # type: ignore[misc]
315+
def __eq__(self, other: timedelta | Timedelta | np.timedelta64) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
316316
@overload
317317
def __eq__(self, other: TimedeltaSeries | Series[pd.Timedelta]) -> Series[bool]: ... # type: ignore[misc]
318318
@overload
@@ -323,7 +323,7 @@ class Timedelta(timedelta):
323323
def __eq__(self, other: object) -> Literal[False]: ...
324324
# Override due to more types supported than dt.timedelta
325325
@overload
326-
def __ne__(self, other: timedelta | Timedelta | np.timedelta64) -> bool: ... # type: ignore[misc]
326+
def __ne__(self, other: timedelta | Timedelta | np.timedelta64) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
327327
@overload
328328
def __ne__(self, other: TimedeltaSeries | Series[pd.Timedelta]) -> Series[bool]: ... # type: ignore[misc]
329329
@overload

pandas-stubs/_libs/tslibs/timestamps.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,15 @@ class Timestamp(datetime):
217217
self, other: npt.NDArray[np.timedelta64]
218218
) -> npt.NDArray[np.datetime64]: ...
219219
@overload
220-
def __eq__(self, other: Timestamp | datetime | np.datetime64) -> bool: ... # type: ignore[misc]
220+
def __eq__(self, other: Timestamp | datetime | np.datetime64) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
221221
@overload
222222
def __eq__(self, other: TimestampSeries | Series[Timestamp]) -> Series[bool]: ... # type: ignore[misc]
223223
@overload
224224
def __eq__(self, other: npt.NDArray[np.datetime64] | Index) -> np_ndarray_bool: ... # type: ignore[misc]
225225
@overload
226226
def __eq__(self, other: object) -> Literal[False]: ...
227227
@overload
228-
def __ne__(self, other: Timestamp | datetime | np.datetime64) -> bool: ... # type: ignore[misc]
228+
def __ne__(self, other: Timestamp | datetime | np.datetime64) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
229229
@overload
230230
def __ne__(self, other: TimestampSeries | Series[Timestamp]) -> Series[bool]: ... # type: ignore[misc]
231231
@overload

pandas-stubs/core/algorithms.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ from pandas._typing import (
2121
# with extension types return the same type while standard type return ndarray
2222

2323
@overload
24-
def unique(values: PeriodIndex) -> PeriodIndex: ... # type: ignore[misc]
24+
def unique(values: PeriodIndex) -> PeriodIndex: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
2525
@overload
2626
def unique(values: CategoricalIndex) -> CategoricalIndex: ... # type: ignore[misc]
2727
@overload

pyproject.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,18 @@ strict_equality = true
171171
show_error_context = false
172172
show_column_numbers = false
173173
show_error_codes = true
174-
always_true = "IS_TYPE_CHECKER_MYPY"
175174

176175
[tool.pyright]
177176
typeCheckingMode = "strict"
178177
stubPath = "."
179178
include = ["tests", "pandas-stubs"]
179+
enableTypeIgnoreComments = false # use pyright-specific ignores
180180
# disable subset of strict
181181
reportInconsistentConstructor = false
182182
reportMissingParameterType = false
183183
reportMissingTypeArgument = false
184184
reportMissingTypeStubs = false
185+
reportUnnecessaryTypeIgnoreComment = true
185186
reportUnknownArgumentType = false
186187
reportUnusedExpression = false
187188
reportUnknownLambdaType = false
@@ -193,5 +194,3 @@ reportUnusedVariable = false
193194
reportPrivateUsage = false
194195
# enable optional checks
195196
reportMissingModuleSource = true
196-
defineConstant = { IS_TYPE_CHECKER_MYPY = false }
197-

tests/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
TYPE_CHECKING_INVALID_USAGE: Final = TYPE_CHECKING
2323
WINDOWS = os.name == "nt" or "cygwin" in platform.system().lower()
2424
PD_LTE_15 = Version(pd.__version__) < Version("1.5.999")
25-
IS_TYPE_CHECKER_MYPY = True
2625

2726
lxml_skip = pytest.mark.skipif(
2827
sys.version_info >= (3, 11), reason="lxml is not available for 3.11 yet"

tests/test_dtypes.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,7 @@ def test_sparse_dtype() -> None:
121121
check(assert_type(pd.SparseDtype(np.timedelta64), pd.SparseDtype), pd.SparseDtype)
122122
check(assert_type(pd.SparseDtype("datetime64"), pd.SparseDtype), pd.SparseDtype)
123123
check(assert_type(pd.SparseDtype(), pd.SparseDtype), pd.SparseDtype)
124-
# pyright ignore because mypy does not like non-minimal unions, while pyright
125-
# can't minimize to check
126-
check(
127-
assert_type(
128-
s_dt.fill_value, # pyright: ignore[reportGeneralTypeIssues]
129-
Union[Scalar, None],
130-
),
131-
int,
132-
)
124+
check(assert_type(s_dt.fill_value, Union[Scalar, None]), int)
133125

134126

135127
def test_string_dtype() -> None:

tests/test_frame.py

+15-17
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
from pandas._typing import Scalar
3939

4040
from tests import (
41-
IS_TYPE_CHECKER_MYPY,
4241
PD_LTE_15,
4342
TYPE_CHECKING_INVALID_USAGE,
4443
check,
@@ -981,7 +980,7 @@ def test_types_window() -> None:
981980
df.expanding()
982981
df.expanding(axis=1)
983982
if TYPE_CHECKING_INVALID_USAGE:
984-
df.expanding(axis=1, center=True) # type: ignore[call-arg]
983+
df.expanding(axis=1, center=True) # type: ignore[call-arg] # pyright: ignore[reportGeneralTypeIssues]
985984

986985
df.rolling(2)
987986
df.rolling(2, axis=1, center=True)
@@ -1780,18 +1779,17 @@ def test_set_columns() -> None:
17801779
# https://github.com/python/mypy/issues/3004
17811780
# pyright accepts this, so we only type check for pyright,
17821781
# and also test the code with pytest
1783-
if (TYPE_CHECKING and not IS_TYPE_CHECKER_MYPY) or not TYPE_CHECKING:
1784-
df.columns = ["c", "d"]
1785-
df.columns = [1, 2]
1786-
df.columns = [1, "a"]
1787-
df.columns = np.array([1, 2])
1788-
df.columns = pd.Series([1, 2])
1789-
df.columns = np.array([1, "a"])
1790-
df.columns = pd.Series([1, "a"])
1791-
df.columns = (1, 2)
1792-
df.columns = (1, "a")
1793-
if TYPE_CHECKING_INVALID_USAGE:
1794-
df.columns = "abc" # pyright: ignore[reportGeneralTypeIssues]
1782+
df.columns = ["c", "d"] # type: ignore[assignment]
1783+
df.columns = [1, 2] # type: ignore[assignment]
1784+
df.columns = [1, "a"] # type: ignore[assignment]
1785+
df.columns = np.array([1, 2]) # type: ignore[assignment]
1786+
df.columns = pd.Series([1, 2]) # type: ignore[assignment]
1787+
df.columns = np.array([1, "a"]) # type: ignore[assignment]
1788+
df.columns = pd.Series([1, "a"]) # type: ignore[assignment]
1789+
df.columns = (1, 2) # type: ignore[assignment]
1790+
df.columns = (1, "a") # type: ignore[assignment]
1791+
if TYPE_CHECKING_INVALID_USAGE:
1792+
df.columns = "abc" # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues]
17951793

17961794

17971795
def test_frame_index_numpy() -> None:
@@ -1828,9 +1826,9 @@ def test_func(h: Hashable):
18281826
pass
18291827

18301828
if TYPE_CHECKING_INVALID_USAGE:
1831-
test_func(pd.DataFrame()) # type: ignore[arg-type]
1832-
test_func(pd.Series([], dtype=object)) # type: ignore[arg-type]
1833-
test_func(pd.Index([])) # type: ignore[arg-type]
1829+
test_func(pd.DataFrame()) # type: ignore[arg-type] # pyright: ignore[reportGeneralTypeIssues]
1830+
test_func(pd.Series([], dtype=object)) # type: ignore[arg-type] # pyright: ignore[reportGeneralTypeIssues]
1831+
test_func(pd.Index([])) # type: ignore[arg-type] # pyright: ignore[reportGeneralTypeIssues]
18341832

18351833

18361834
def test_columns_mixlist() -> None:

tests/test_interval.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ def test_interval_length() -> None:
5050

5151
check(assert_type(idres, "pd.Interval[pd.Timestamp]"), pd.Interval, pd.Timestamp)
5252
if TYPE_CHECKING_INVALID_USAGE:
53-
20 in i1 # type: ignore[operator]
54-
i1 + pd.Timestamp("2000-03-03") # type: ignore[operator]
55-
i1 * 3 # type: ignore[operator]
56-
i1 * pd.Timedelta(seconds=20) # type: ignore[operator]
53+
20 in i1 # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
54+
i1 + pd.Timestamp("2000-03-03") # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
55+
i1 * 3 # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
56+
i1 * pd.Timedelta(seconds=20) # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
5757

5858
i2 = pd.Interval(10, 20)
5959
check(assert_type(i2.length, int), int)
@@ -69,8 +69,8 @@ def test_interval_length() -> None:
6969
check(assert_type(i2 * 4.2, "pd.Interval[float]"), pd.Interval, float)
7070

7171
if TYPE_CHECKING_INVALID_USAGE:
72-
pd.Timestamp("2001-01-02") in i2 # type: ignore[operator]
73-
i2 + pd.Timedelta(seconds=20) # type: ignore[type-var]
72+
pd.Timestamp("2001-01-02") in i2 # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
73+
i2 + pd.Timedelta(seconds=20) # type: ignore[type-var] # pyright: ignore[reportGeneralTypeIssues]
7474
i3 = pd.Interval(13.2, 19.5)
7575
check(assert_type(i3.length, float), float)
7676
check(assert_type(i3.left, float), float)
@@ -82,5 +82,5 @@ def test_interval_length() -> None:
8282
check(assert_type(i3 + 3, "pd.Interval[float]"), pd.Interval, float)
8383
check(assert_type(i3 * 3, "pd.Interval[float]"), pd.Interval, float)
8484
if TYPE_CHECKING_INVALID_USAGE:
85-
pd.Timestamp("2001-01-02") in i3 # type: ignore[operator]
86-
i3 + pd.Timedelta(seconds=20) # type: ignore[operator]
85+
pd.Timestamp("2001-01-02") in i3 # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
86+
i3 + pd.Timedelta(seconds=20) # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]

tests/test_pandas.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1208,24 +1208,24 @@ def test_merge_ordered() -> None:
12081208
rs,
12091209
left_on="left",
12101210
right_on="right",
1211-
left_by="left", # pyright: ignore
1212-
right_by="right", # pyright: ignore
1211+
left_by="left", # pyright: ignore[reportGeneralTypeIssues]
1212+
right_by="right", # pyright: ignore[reportGeneralTypeIssues]
12131213
)
12141214
pd.merge_ordered( # type: ignore[call-overload]
12151215
ls,
1216-
rf, # pyright: ignore
1216+
rf, # pyright: ignore[reportGeneralTypeIssues]
12171217
left_on="left",
12181218
right_on="b",
1219-
left_by="left", # pyright: ignore
1220-
right_by="b", # pyright: ignore
1219+
left_by="left", # pyright: ignore[reportGeneralTypeIssues]
1220+
right_by="b", # pyright: ignore[reportGeneralTypeIssues]
12211221
)
12221222
pd.merge_ordered( # type: ignore[call-overload]
12231223
lf,
12241224
rs,
12251225
left_on="a",
12261226
right_on="right",
1227-
left_by="a", # pyright: ignore
1228-
right_by="right", # pyright: ignore
1227+
left_by="a", # pyright: ignore[reportGeneralTypeIssues]
1228+
right_by="right", # pyright: ignore[reportGeneralTypeIssues]
12291229
)
12301230

12311231

tests/test_scalars.py

+27-31
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from pandas._libs.tslibs.timedeltas import Components
2727

2828
from tests import (
29-
IS_TYPE_CHECKER_MYPY,
3029
PD_LTE_15,
3130
TYPE_CHECKING_INVALID_USAGE,
3231
check,
@@ -607,14 +606,14 @@ def test_timedelta_add_sub() -> None:
607606
# TypeError: as_period, as_timestamp, as_datetime, as_date, as_datetime64,
608607
# as_period_index, as_datetime_index, as_ndarray_dt64
609608
if TYPE_CHECKING_INVALID_USAGE:
610-
td - as_period # type: ignore[operator]
611-
td - as_timestamp # type: ignore[operator]
612-
td - as_datetime # type: ignore[operator]
613-
td - as_date # type: ignore[operator]
614-
td - as_datetime64 # type: ignore[operator]
615-
td - as_period_index # type: ignore[operator]
616-
td - as_datetime_index # type: ignore[operator]
617-
td - as_ndarray_dt64 # type: ignore[operator]
609+
td - as_period # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
610+
td - as_timestamp # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
611+
td - as_datetime # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
612+
td - as_date # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
613+
td - as_datetime64 # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
614+
td - as_period_index # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
615+
td - as_datetime_index # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
616+
td - as_ndarray_dt64 # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
618617

619618
check(assert_type(td - td, pd.Timedelta), pd.Timedelta)
620619
check(assert_type(td - as_dt_timedelta, pd.Timedelta), pd.Timedelta)
@@ -746,14 +745,14 @@ def test_timedelta_mul_div() -> None:
746745
# TypeError: md_int, md_float, md_ndarray_intp, md_ndarray_float, mp_series_int,
747746
# mp_series_float, md_int64_index, md_float_index
748747
if TYPE_CHECKING_INVALID_USAGE:
749-
md_int // td # type: ignore[operator]
750-
md_float // td # type: ignore[operator]
751-
md_ndarray_intp // td # type: ignore[operator]
752-
md_ndarray_float // td # type: ignore[operator]
753-
mp_series_int // td # type: ignore[operator]
754-
md_series_float // td # type: ignore[operator]
755-
md_int64_index // td # type: ignore[operator]
756-
md_float_index // td # type: ignore[operator]
748+
md_int // td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
749+
md_float // td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
750+
md_ndarray_intp // td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
751+
md_ndarray_float // td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
752+
mp_series_int // td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
753+
md_series_float // td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
754+
md_int64_index // td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
755+
md_float_index // td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
757756

758757
check(assert_type(td / td, float), float)
759758
check(assert_type(td / pd.NaT, float), float)
@@ -780,14 +779,14 @@ def test_timedelta_mul_div() -> None:
780779
# TypeError: md_int, md_float, md_ndarray_intp, md_ndarray_float, mp_series_int,
781780
# mp_series_float, md_int64_index, md_float_index
782781
if TYPE_CHECKING_INVALID_USAGE:
783-
md_int / td # type: ignore[operator]
784-
md_float / td # type: ignore[operator]
785-
md_ndarray_intp / td # type: ignore[operator]
786-
md_ndarray_float / td # type: ignore[operator]
787-
mp_series_int / td # type: ignore[operator]
788-
md_series_float / td # type: ignore[operator]
789-
md_int64_index / td # type: ignore[operator]
790-
md_float_index / td # type: ignore[operator]
782+
md_int / td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
783+
md_float / td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
784+
md_ndarray_intp / td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
785+
md_ndarray_float / td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
786+
mp_series_int / td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
787+
md_series_float / td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
788+
md_int64_index / td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
789+
md_float_index / td # type: ignore[operator] # pyright: ignore[reportGeneralTypeIssues]
791790

792791

793792
def test_timedelta_mod_abs_unary() -> None:
@@ -826,12 +825,9 @@ def test_timedelta_mod_abs_unary() -> None:
826825
pd.TimedeltaIndex,
827826
)
828827

829-
if TYPE_CHECKING and IS_TYPE_CHECKER_MYPY:
830-
# mypy reports dt.timedelta, even though __abs__ returns Timedelta
831-
check(assert_type(abs(td), pd.Timedelta), pd.Timedelta) # type: ignore[assert-type]
832-
else:
833-
# This is valid for pyright
834-
check(assert_type(abs(td), pd.Timedelta), pd.Timedelta)
828+
# mypy reports dt.timedelta, even though __abs__ returns Timedelta
829+
check(assert_type(abs(td), pd.Timedelta), pd.Timedelta) # type: ignore[assert-type]
830+
835831
check(assert_type(td.__abs__(), pd.Timedelta), pd.Timedelta)
836832
check(assert_type(-td, pd.Timedelta), pd.Timedelta)
837833
check(assert_type(+td, pd.Timedelta), pd.Timedelta)

tests/test_series.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def test_types_sort_values() -> None:
238238
s = pd.Series([4, 2, 1, 3])
239239
check(assert_type(s.sort_values(), pd.Series), pd.Series)
240240
if TYPE_CHECKING_INVALID_USAGE:
241-
check(assert_type(s.sort_values(0), pd.Series), pd.Series) # type: ignore[assert-type,call-overload]
241+
check(assert_type(s.sort_values(0), pd.Series), pd.Series) # type: ignore[assert-type,call-overload] # pyright: ignore[reportGeneralTypeIssues]
242242
check(assert_type(s.sort_values(axis=0), pd.Series), pd.Series)
243243
check(assert_type(s.sort_values(ascending=False), pd.Series), pd.Series)
244244
assert assert_type(s.sort_values(inplace=True, kind="quicksort"), None) is None
@@ -560,7 +560,7 @@ def test_types_window() -> None:
560560
s.expanding()
561561
s.expanding(axis=0)
562562
if TYPE_CHECKING_INVALID_USAGE:
563-
s.expanding(axis=0, center=True) # type: ignore[call-arg]
563+
s.expanding(axis=0, center=True) # type: ignore[call-arg] # pyright: ignore[reportGeneralTypeIssues]
564564

565565
s.rolling(2)
566566
s.rolling(2, axis=0, center=True)
@@ -748,7 +748,7 @@ def add1(x: int) -> int:
748748
s6: None = pd.Series([1, 2, 3]).rename("A", inplace=True)
749749

750750
if TYPE_CHECKING_INVALID_USAGE:
751-
s7 = pd.Series([1, 2, 3]).rename({1: [3, 4, 5]}) # type: ignore[dict-item]
751+
s7 = pd.Series([1, 2, 3]).rename({1: [3, 4, 5]}) # type: ignore[dict-item] # pyright: ignore[reportGeneralTypeIssues]
752752

753753

754754
def test_types_ne() -> None:

tests/test_testing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_types_assert_series_equal() -> None:
2929
check_datetimelike_compat=True,
3030
)
3131
if TYPE_CHECKING_INVALID_USAGE:
32-
assert_series_equal( # type: ignore[call-overload]
32+
assert_series_equal( # type: ignore[call-overload] # pyright: ignore[reportGeneralTypeIssues]
3333
s1,
3434
s2,
3535
check_dtype=True,

0 commit comments

Comments
 (0)