Skip to content

Commit 0e554d7

Browse files
GH1570 Fix nightly issue with None/NA/NaT set (#1571)
1 parent d063f4c commit 0e554d7

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

tests/frame/test_indexing.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from pandas._typing import Scalar
2828

2929
from tests import (
30+
PD_LTE_23,
3031
TYPE_CHECKING_INVALID_USAGE,
3132
check,
3233
)
@@ -428,16 +429,18 @@ def test_frame_setitem_na() -> None:
428429
df.at["a", "y"] = None
429430
df.iat[0, 0] = None
430431

431-
df.loc[:, "x"] = [None, pd.NA, pd.NaT]
432-
df.iloc[:, 0] = [None, pd.NA, pd.NaT]
432+
if PD_LTE_23:
433+
# TODO: pandas-dev/pandas#63420, this is failing on latest build, should work
434+
df.loc[:, "x"] = [None, pd.NA, pd.NaT]
435+
df.iloc[:, 0] = [None, pd.NA, pd.NaT]
433436

434-
# TODO: mypy bug, remove after python/mypy#20420 has been resolved
435-
df.loc[:, ["x"]] = [[None], [pd.NA], [pd.NaT]] # type: ignore[assignment,index]
436-
df.iloc[:, [0]] = [[None], [pd.NA], [pd.NaT]] # type: ignore[assignment,index]
437+
# TODO: mypy bug, remove after python/mypy#20420 has been resolved
438+
df.loc[:, ["x"]] = [[None], [pd.NA], [pd.NaT]] # type: ignore[assignment,index]
439+
df.iloc[:, [0]] = [[None], [pd.NA], [pd.NaT]] # type: ignore[assignment,index]
437440

438-
# TODO: mypy bug, remove after python/mypy#20420 has been resolved
439-
df.loc[:, iter(["x"])] = [[None], [pd.NA], [pd.NaT]] # type: ignore[assignment,index]
440-
df.iloc[:, iter([0])] = [[None], [pd.NA], [pd.NaT]] # type: ignore[assignment,index]
441+
# TODO: mypy bug, remove after python/mypy#20420 has been resolved
442+
df.loc[:, iter(["x"])] = [[None], [pd.NA], [pd.NaT]] # type: ignore[assignment,index]
443+
df.iloc[:, iter([0])] = [[None], [pd.NA], [pd.NaT]] # type: ignore[assignment,index]
441444

442445

443446
def test_loc_set() -> None:

0 commit comments

Comments
 (0)