@@ -1287,7 +1287,7 @@ def test_timestamp_cmp_series() -> None:
1287
1287
def test_timestamp_cmp_index () -> None :
1288
1288
ts = pd .Timestamp (year = 2000 , month = 3 , day = 24 , hour = 12 , minute = 27 )
1289
1289
dt_idx = pd .DatetimeIndex (["2000-1-1" ])
1290
- # DatetimeIndex, but the type checker thinks it is UnknownIndex .
1290
+ # DatetimeIndex, but the type checker thinks it is Index[Any] .
1291
1291
un_idx = pd .DataFrame ({"a" : [1 ]}, index = dt_idx ).index
1292
1292
1293
1293
# >, <=
@@ -1322,8 +1322,9 @@ def test_timestamp_cmp_index() -> None:
1322
1322
eq_dt1 = check (assert_type (ts == dt_idx , np_1darray [np .bool ]), np_1darray [np .bool ])
1323
1323
ne_dt1 = check (assert_type (ts != dt_idx , np_1darray [np .bool ]), np_1darray [np .bool ])
1324
1324
assert (eq_dt1 != ne_dt1 ).all ()
1325
- eq_un1 = check (assert_type (ts == un_idx , np_1darray [np .bool ]), np_1darray [np .bool ])
1326
- ne_un1 = check (assert_type (ts != un_idx , np_1darray [np .bool ]), np_1darray [np .bool ])
1325
+ # there is a mypy bug where ts.__eq__(Index) gets revealed as Any and not np_1darray
1326
+ eq_un1 = check (assert_type (ts == un_idx , np_1darray [np .bool ]), np_1darray [np .bool ]) # type: ignore[assert-type]
1327
+ ne_un1 = check (assert_type (ts != un_idx , np_1darray [np .bool ]), np_1darray [np .bool ]) # type: ignore[assert-type]
1327
1328
assert (eq_un1 != ne_un1 ).all ()
1328
1329
1329
1330
# ==, != (ts on the rhs, use == and != of lhs)
0 commit comments