We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df0aa86 commit ef2fda8Copy full SHA for ef2fda8
pandas/tests/frame/indexing/test_coercion.py
@@ -91,19 +91,11 @@ def test_26395(indexer_al):
91
expected = DataFrame({"D": [0, 0, 2]}, index=["A", "B", "C"], dtype=np.int64)
92
tm.assert_frame_equal(df, expected)
93
94
- with tm.assert_produces_warning(
95
- FutureWarning, match="Setting an item of incompatible dtype"
96
- ):
+ with pytest.raises(TypeError, match="Invalid value"):
97
indexer_al(df)["C", "D"] = 44.5
98
- expected = DataFrame({"D": [0, 0, 44.5]}, index=["A", "B", "C"], dtype=np.float64)
99
- tm.assert_frame_equal(df, expected)
100
101
102
103
104
indexer_al(df)["C", "D"] = "hello"
105
- expected = DataFrame({"D": [0, 0, "hello"]}, index=["A", "B", "C"], dtype=object)
106
107
108
109
@pytest.mark.xfail(reason="unwanted upcast")
0 commit comments