Skip to content

TST: raising ValueError when inserting one dataframe in another #42831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pandas/tests/frame/indexing/test_insert.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,13 @@ def test_insert_item_cache(self, using_array_manager):
ser.values[0] = 99

assert df.iloc[0, 0] == df[0][0]

def test_insert_frame(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your test is broken

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very confused. I am getting a seperate error message on my local.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ci error is correct, you will have to debug locally why it is not raised for you

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed the error msg, but this is also failing. Would need some help, how same error raises multiple error msgs

# GH#42403
df = DataFrame({"col1": [1, 2], "col2": [3, 4]})
msg = (
"Expected a 1D array, got an array with shape "
r"\(2, 2\)|Wrong number of items passed 2, placement implies 1"
)
with pytest.raises(ValueError, match=msg):
df.insert(1, "newcol", df)