Skip to content

Commit 46c994c

Browse files
committed
TST: raising ValueError when inserting one dataframe in another
1 parent 7963422 commit 46c994c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/frame/indexing/test_insert.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,9 @@ def test_insert_item_cache(self, using_array_manager):
8989
ser.values[0] = 99
9090

9191
assert df.iloc[0, 0] == df[0][0]
92+
93+
def test_insert_frame(self):
94+
df = DataFrame({"col1": [1, 2], "col2": [3, 4]})
95+
msg = "Wrong number of items passed 2, placement implies 1"
96+
with pytest.raises(ValueError, match=msg):
97+
df.insert(1, "newcol", df)

0 commit comments

Comments
 (0)