Skip to content

Commit f62f79c

Browse files
committed
1 parent cc37848 commit f62f79c

2 files changed

Lines changed: 13 additions & 29 deletions

File tree

‎tests/arrays/test_datetime_array.py‎

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,8 @@ def test_construction_sequence_pandas(
8080
DatetimeArray,
8181
)
8282
if sys.version_info >= (3, 12):
83-
# TODO: pandas-dev/pandas-stubs#1786
84-
assert_type( # type: ignore[assert-type]
85-
pd.array([np.datetime64("2026-01-05 23:27:59")]), DatetimeArray
86-
)
83+
# TODO: python/mypy#21733
84+
assert_type(pd.array([np.datetime64("2026-01-05 23:27:59")]), DatetimeArray) # type: ignore[assert-type]
8785
else:
8886
assert_type(pd.array([np.datetime64("2026-01-05 23:27:59")]), DatetimeArray)
8987

@@ -97,19 +95,9 @@ def test_construction_sequence_pandas(
9795
pd.array([datetime(2052, 1, 5), pd.Timestamp(2, 1, 6)]), DatetimeArray
9896
)
9997
if sys.version_info >= (3, 12):
100-
# TODO: pandas-dev/pandas-stubs#1786
101-
assert_type( # type: ignore[assert-type]
102-
pd.array(
103-
[np.datetime64("2026-01-05 23:27:59"), np.datetime64("1748-01-06")]
104-
),
105-
DatetimeArray,
106-
)
107-
assert_type( # type: ignore[assert-type]
108-
pd.array(
109-
[np.datetime64("2131-01-05 01:25"), np.datetime64("1748-01-06")]
110-
),
111-
DatetimeArray,
112-
)
98+
# TODO: python/mypy#21733
99+
assert_type(pd.array([np.datetime64("2026-01-05 23:27:59"), np.datetime64("1748-01-06")]), DatetimeArray) # type: ignore[assert-type]
100+
assert_type(pd.array([np.datetime64("2131-01-05 01:25"), np.datetime64("1748-01-06")]), DatetimeArray) # type: ignore[assert-type]
113101
else:
114102
assert_type(
115103
pd.array(
@@ -135,10 +123,8 @@ def test_construction_sequence_pandas(
135123
assert_type(pd.array([datetime(2061, 1, 5, 1), None]), DatetimeArray)
136124
assert_type(pd.array([pd.Timestamp(1902, 1, 5, 3), None]), DatetimeArray)
137125
if sys.version_info >= (3, 12):
138-
# TODO: pandas-dev/pandas-stubs#1786
139-
assert_type( # type: ignore[assert-type]
140-
pd.array([np.datetime64("2111-01-05"), None]), DatetimeArray
141-
)
126+
# TODO: python/mypy#21733
127+
assert_type(pd.array([np.datetime64("2111-01-05"), None]), DatetimeArray) # type: ignore[assert-type]
142128
else:
143129
assert_type(pd.array([np.datetime64("2111-01-05"), None]), DatetimeArray)
144130

@@ -151,10 +137,8 @@ def test_construction_sequence_pandas(
151137
pd.array([pd.Timestamp(2102, 1, 5, 3), None, pd.NaT]), DatetimeArray
152138
)
153139
if sys.version_info >= (3, 12):
154-
# TODO: pandas-dev/pandas-stubs#1786
155-
assert_type( # type: ignore[assert-type]
156-
pd.array([np.datetime64("2114-01-05"), None, pd.NaT]), DatetimeArray
157-
)
140+
# TODO: python/mypy#21733
141+
assert_type(pd.array([np.datetime64("2114-01-05"), None, pd.NaT]), DatetimeArray) # type: ignore[assert-type]
158142
else:
159143
assert_type(
160144
pd.array([np.datetime64("2114-01-05"), None, pd.NaT]), DatetimeArray
@@ -163,7 +147,7 @@ def test_construction_sequence_pandas(
163147
assert_type(pd.array((datetime(2026, 1, 5),)), DatetimeArray)
164148
assert_type(pd.array(UserList([pd.Timestamp(2026, 1, 5)])), DatetimeArray)
165149
if sys.version_info >= (3, 12):
166-
# TODO: pandas-dev/pandas-stubs#1786
150+
# TODO: python/mypy#21733
167151
assert_type(pd.array((np.datetime64("1959-01-05"),)), DatetimeArray) # type: ignore[assert-type]
168152
assert_type(pd.array(UserList([np.datetime64("1701-01-05")])), DatetimeArray) # type: ignore[assert-type]
169153
else:
@@ -360,7 +344,7 @@ def test_constructor() -> None:
360344
check(assert_type(pd.array([np_dt, None]), DatetimeArray), DatetimeArray)
361345
dt_nat = cast(list[np.datetime64 | NaTType], [np_dt, pd.NaT])
362346
if sys.version_info >= (3, 12):
363-
# TODO: pandas-dev/pandas-stubs#1786
347+
# TODO: python/mypy#21733
364348
check(assert_type(pd.array(dt_nat), DatetimeArray), DatetimeArray) # type: ignore[assert-type]
365349
else:
366350
check(assert_type(pd.array(dt_nat), DatetimeArray), DatetimeArray)

‎tests/scalars/test_scalars.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ def test_timedelta_cmp_array() -> None:
922922
assert (lt_1d2 != ge_1d2).all()
923923

924924
# ==, !=
925-
# TODO: pandas-dev/pandas-stubs#1786 facebook/pyrefly#3977
925+
# TODO: python/mypy#21733 facebook/pyrefly#3977
926926
if sys.version_info >= (3, 12):
927927
eq_nd1 = check(assert_type(td == arr_nd, np_ndarray_bool), np_ndarray_bool, np.bool) # type: ignore[assert-type] # pyrefly: ignore[assert-type]
928928
ne_nd1 = check(assert_type(td != arr_nd, np_ndarray_bool), np_ndarray_bool, np.bool) # type: ignore[assert-type] # pyrefly: ignore[assert-type]
@@ -1356,7 +1356,7 @@ def test_timestamp_cmp_array() -> None:
13561356
assert (lt_1d2 != ge_1d2).all()
13571357

13581358
# ==, !=
1359-
# TODO: pandas-dev/pandas-stubs#1786 facebook/pyrefly#3977
1359+
# TODO: python/mypy#21733 facebook/pyrefly#3977
13601360
if sys.version_info >= (3, 12):
13611361
eq_nd1 = check(assert_type(ts == arr_nd, np_ndarray_bool), np_ndarray_bool, np.bool) # type: ignore[assert-type] # pyrefly: ignore[assert-type]
13621362
ne_nd1 = check(assert_type(ts != arr_nd, np_ndarray_bool), np_ndarray_bool, np.bool) # type: ignore[assert-type] # pyrefly: ignore[assert-type]

0 commit comments

Comments
 (0)