Skip to content

Commit d97dcda

Browse files
kognateproost
authored andcommitted
TST: add test to confirm adding 'm' to a Series of strings does not error (pandas-dev#28736)
1 parent a43bd52 commit d97dcda

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pandas/tests/series/test_arithmetic.py

+15
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,21 @@ def test_add_series_with_period_index(self):
6666
with pytest.raises(IncompatibleFrequency, match=msg):
6767
ts + ts.asfreq("D", how="end")
6868

69+
@pytest.mark.parametrize(
70+
"target_add,input_value,expected_value",
71+
[
72+
("!", ["hello", "world"], ["hello!", "world!"]),
73+
("m", ["hello", "world"], ["hellom", "worldm"]),
74+
],
75+
)
76+
def test_string_addition(self, target_add, input_value, expected_value):
77+
# GH28658 - ensure adding 'm' does not raise an error
78+
a = Series(input_value)
79+
80+
result = a + target_add
81+
expected = Series(expected_value)
82+
tm.assert_series_equal(result, expected)
83+
6984

7085
# ------------------------------------------------------------------
7186
# Comparisons

0 commit comments

Comments
 (0)