Skip to content

FIX: add additional condition to check invalid type(#28277) #28319

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

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
TST: add testcase in test_str_cat_raises_intuitive_error(#28277)
  • Loading branch information
paichana committed Sep 6, 2019
commit d8e28b59039e914d0f66278ef288c57d47bdaba9
5 changes: 5 additions & 0 deletions pandas/tests/test_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,11 @@ def test_str_cat_raises_intuitive_error(self, box):
with pytest.raises(ValueError, match=message):
s.str.cat(" ")

# test whether error is raise when others is StringMethod
message = "others must be Series, Index, DataFrame,.*"
with pytest.raises(TypeError, match=message):
s.str.cat(others=s.str)

@pytest.mark.parametrize("sep", ["", None])
@pytest.mark.parametrize("dtype_target", ["object", "category"])
@pytest.mark.parametrize("dtype_caller", ["object", "category"])
Expand Down