Skip to content

Adds test for string series addition #28732

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 5 commits into from
Closed
Changes from 2 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
8 changes: 8 additions & 0 deletions pandas/tests/series/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ def test_add_series_with_period_index(self):
with pytest.raises(IncompatibleFrequency, match=msg):
ts + ts.asfreq("D", how="end")

def test_string_addition(self):
# GH28658
a = Series(["hello", "world"])

result = a + "!"
Copy link
Member

Choose a reason for hiding this comment

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

We want to test + "m" as well as the issue notes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I've added that, but this branch is messier than I'd like it to be so I'm going to close this PR and clean up this branch and recreate the PR.

expected = Series(["hello!", "world!"])
tm.assert_series_equal(result, expected)


# ------------------------------------------------------------------
# Comparisons
Expand Down