File tree 2 files changed +4
-9
lines changed
2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,7 @@ def scalar_rep(x):
198
198
return self ._str_map (scalar_rep , dtype = str )
199
199
else :
200
200
from pandas .core .arrays .string_ import StringArray
201
+ from pandas .core .arrays .string_arrow import ArrowStringArray
201
202
202
203
def rep (x , r ):
203
204
if x is libmissing .NA :
@@ -209,9 +210,9 @@ def rep(x, r):
209
210
210
211
repeats = np .asarray (repeats , dtype = object )
211
212
result = libops .vec_binop (np .asarray (self ), repeats , rep )
212
- if isinstance (self , StringArray ):
213
+ if isinstance (self , ( StringArray , ArrowStringArray ) ):
213
214
# Not going through map, so we have to do this here.
214
- result = StringArray ._from_sequence (result )
215
+ result = type ( self ) ._from_sequence (result )
215
216
return result
216
217
217
218
def _str_match (
Original file line number Diff line number Diff line change @@ -136,14 +136,8 @@ def test_repeat():
136
136
tm .assert_series_equal (rs , xp )
137
137
138
138
139
- def test_repeat_with_null (nullable_string_dtype , request ):
139
+ def test_repeat_with_null (nullable_string_dtype ):
140
140
# GH: 31632
141
-
142
- if nullable_string_dtype == "arrow_string" :
143
- reason = 'Attribute "dtype" are different'
144
- mark = pytest .mark .xfail (reason = reason )
145
- request .node .add_marker (mark )
146
-
147
141
ser = Series (["a" , None ], dtype = nullable_string_dtype )
148
142
result = ser .str .repeat ([3 , 4 ])
149
143
expected = Series (["aaa" , None ], dtype = nullable_string_dtype )
You can’t perform that action at this time.
0 commit comments