Skip to content

Commit bc14f55

Browse files
committed
wip
1 parent a63e410 commit bc14f55

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

pandas/tests/frame/indexing/test_indexing.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
Timestamp,
2626
date_range,
2727
isna,
28-
notna,
2928
to_datetime,
3029
)
3130
import pandas._testing as tm
@@ -936,12 +935,8 @@ def test_setitem_frame_upcast(self):
936935
# needs upcasting
937936
df = DataFrame([[1, 2, "foo"], [3, 4, "bar"]], columns=["A", "B", "C"])
938937
df2 = df.copy()
939-
with tm.assert_produces_warning(FutureWarning, match="incompatible dtype"):
938+
with pytest.raises(TypeError, match="Invalid value"):
940939
df2.loc[:, ["A", "B"]] = df.loc[:, ["A", "B"]] + 0.5
941-
expected = df.reindex(columns=["A", "B"])
942-
expected += 0.5
943-
expected["C"] = df["C"]
944-
tm.assert_frame_equal(df2, expected)
945940

946941
def test_setitem_frame_align(self, float_frame):
947942
piece = float_frame.loc[float_frame.index[:2], ["A", "B"]]
@@ -1579,18 +1574,9 @@ def test_setitem(self):
15791574
# With NaN: because uint64 has no NaN element,
15801575
# the column should be cast to object.
15811576
df2 = df.copy()
1582-
with tm.assert_produces_warning(FutureWarning, match="incompatible dtype"):
1577+
with pytest.raises(TypeError, match="Invalid value"):
15831578
df2.iloc[1, 1] = pd.NaT
15841579
df2.iloc[1, 2] = pd.NaT
1585-
result = df2["B"]
1586-
tm.assert_series_equal(notna(result), Series([True, False, True], name="B"))
1587-
tm.assert_series_equal(
1588-
df2.dtypes,
1589-
Series(
1590-
[np.dtype("uint64"), np.dtype("O"), np.dtype("O")],
1591-
index=["A", "B", "C"],
1592-
),
1593-
)
15941580

15951581

15961582
def test_object_casting_indexing_wraps_datetimelike():

0 commit comments

Comments
 (0)