Skip to content

Commit f79c707

Browse files
committed
Change test for 22721 and adapt whatsnew
1 parent b3c8834 commit f79c707

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

doc/source/whatsnew/v0.24.0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ Other API Changes
544544
- :class:`Index` subtraction will attempt to operate element-wise instead of raising ``TypeError`` (:issue:`19369`)
545545
- :class:`pandas.io.formats.style.Styler` supports a ``number-format`` property when using :meth:`~pandas.io.formats.style.Styler.to_excel` (:issue:`22015`)
546546
- :meth:`DataFrame.corr` and :meth:`Series.corr` now raise a ``ValueError`` along with a helpful error message instead of a ``KeyError`` when supplied with an invalid method (:issue:`22298`)
547-
- :meth:`Series.str.cat` now also works for binary data in Python 3 (:issue:`22721`)
547+
- :meth:`Series.str.cat` now also works more consistently for binary data in Python 3, although use of the `.str`-accessor for binary data is not recommended (:issue:`22721`)
548548
- :meth:`shift` will now always return a copy, instead of the previous behaviour of returning self when shifting by 0 (:issue:`22397`)
549549

550550
.. _whatsnew_0240.deprecations:

pandas/tests/test_strings.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3088,7 +3088,10 @@ def test_str_accessor_no_new_attributes(self):
30883088
def test_method_on_bytes(self):
30893089
lhs = Series(np.array(list('abc'), 'S1').astype(object))
30903090
rhs = Series(np.array(list('def'), 'S1').astype(object))
3091-
3092-
result = lhs.str.cat(rhs)
3093-
expected = Series(np.array(['ad', 'be', 'cf'], 'S2').astype(object))
3094-
tm.assert_series_equal(result, expected)
3091+
if compat.PY3:
3092+
pytest.raises(TypeError, lhs.str.cat, rhs, sep=',')
3093+
else:
3094+
result = lhs.str.cat(rhs)
3095+
expected = Series(np.array(
3096+
['ad', 'be', 'cf'], 'S2').astype(object))
3097+
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)