Skip to content

Commit 6a5c71f

Browse files
committed
Add test
1 parent 7c67b23 commit 6a5c71f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pandas/tests/reshape/concat/test_concat.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,3 +939,15 @@ def test_concat_with_series_and_frame_returns_rangeindex_columns():
939939
result = concat([ser, df])
940940
expected = DataFrame([0, 1, 2], index=[0, 0, 1])
941941
tm.assert_frame_equal(result, expected, check_column_type=True)
942+
943+
944+
def test_concat_with_moot_combination_of_arguments():
945+
df1 = DataFrame([[0]])
946+
df2 = DataFrame([[42]])
947+
948+
msg = (
949+
"Setting ignore_index to true and providing key values are "
950+
"counterproductive. Either should be used."
951+
)
952+
with pytest.raises(ValueError, match=msg):
953+
concat([df1, df2], keys=["df1", "df2"], ignore_index=True)

0 commit comments

Comments
 (0)