Skip to content

Commit bb91b3e

Browse files
committed
Revert fix for 22722
1 parent 8ff8c32 commit bb91b3e

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

pandas/core/strings.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,13 +2118,6 @@ def cat(self, others=None, sep=None, na_rep=None, join=None):
21182118
'must all be of the same length as the '
21192119
'calling Series/Index.')
21202120

2121-
if any(not is_object_dtype(x)
2122-
and not (is_categorical_dtype(x)
2123-
and is_object_dtype(x.cat.categories))
2124-
for x in others):
2125-
raise TypeError('All columns in others must contain only strings '
2126-
'(or missing values)!')
2127-
21282121
if join is None and warn:
21292122
warnings.warn("A future version of pandas will perform index "
21302123
"alignment when `others` is a Series/Index/"

pandas/tests/test_strings.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,6 @@ def test_str_cat_categorical(self, box, dtype_caller, dtype_target):
195195
result = s.str.cat(t)
196196
assert_series_or_index_equal(result, expected)
197197

198-
# errors for inputs not consisting of strings (also when categorical)
199-
rgx = 'All columns in others must contain only strings.*'
200-
201-
# data with non-object dtype
202-
with tm.assert_raises_regex(TypeError, rgx):
203-
s.str.cat(Series([1, 2, 3, 4]))
204-
205198
@pytest.mark.parametrize('box', [Series, Index])
206199
def test_str_cat_mixed_inputs(self, box):
207200
s = Index(['a', 'b', 'c', 'd'])
@@ -312,13 +305,6 @@ def test_str_cat_mixed_inputs(self, box):
312305
with tm.assert_raises_regex(TypeError, rgx):
313306
s.str.cat(1)
314307

315-
# errors for inputs not consisting of strings
316-
rgx = 'All columns in others must contain only strings.*'
317-
318-
# data with non-object dtype
319-
with tm.assert_raises_regex(TypeError, rgx):
320-
s.str.cat(Series([1, 2, 3, 4]))
321-
322308
@pytest.mark.parametrize('join', ['left', 'outer', 'inner', 'right'])
323309
@pytest.mark.parametrize('box', [Series, Index])
324310
def test_str_cat_align_indexed(self, box, join):

0 commit comments

Comments
 (0)