File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -204,15 +204,15 @@ def _str_swapcase(self) -> Self:
204204
205205 def _str_removeprefix (self , prefix : str ):
206206 if prefix == "" :
207- return self
207+ return self . copy ()
208208 starts_with = pc .starts_with (self ._pa_array , pattern = prefix )
209209 removed = pc .utf8_slice_codeunits (self ._pa_array , len (prefix ))
210210 result = pc .if_else (starts_with , removed , self ._pa_array )
211211 return self ._from_pyarrow_array (result )
212212
213213 def _str_removesuffix (self , suffix : str ):
214214 if suffix == "" :
215- return self
215+ return self . copy ()
216216 ends_with = pc .ends_with (self ._pa_array , pattern = suffix )
217217 removed = pc .utf8_slice_codeunits (self ._pa_array , 0 , stop = - len (suffix ))
218218 result = pc .if_else (ends_with , removed , self ._pa_array )
You can’t perform that action at this time.
0 commit comments