22
22
from pyspark import pandas as ps
23
23
from pyspark .testing .pandasutils import PandasOnSparkTestCase
24
24
from pyspark .testing .sqlutils import SQLTestUtils
25
- from pyspark .testing .utils import is_ansi_mode_test , ansi_mode_not_supported_message
26
25
27
26
28
27
class SeriesStringOpsAdvMixin :
@@ -174,7 +173,6 @@ def test_string_slice_replace(self):
174
173
self .check_func (lambda x : x .str .slice_replace (stop = 2 , repl = "X" ))
175
174
self .check_func (lambda x : x .str .slice_replace (start = 1 , stop = 3 , repl = "X" ))
176
175
177
- @unittest .skipIf (is_ansi_mode_test , ansi_mode_not_supported_message )
178
176
def test_string_split (self ):
179
177
self .check_func_on_series (lambda x : repr (x .str .split ()), self .pser [:- 1 ])
180
178
self .check_func_on_series (lambda x : repr (x .str .split (r"p*" )), self .pser [:- 1 ])
@@ -187,7 +185,6 @@ def test_string_split(self):
187
185
188
186
self .check_func_on_series (lambda x : repr (x .str .split ("-" , n = 1 , expand = True )), pser )
189
187
190
- @unittest .skipIf (is_ansi_mode_test , ansi_mode_not_supported_message )
191
188
def test_string_rsplit (self ):
192
189
self .check_func_on_series (lambda x : repr (x .str .rsplit ()), self .pser [:- 1 ])
193
190
self .check_func_on_series (lambda x : repr (x .str .rsplit (r"p*" )), self .pser [:- 1 ])
@@ -198,6 +195,8 @@ def test_string_rsplit(self):
198
195
with self .assertRaises (NotImplementedError ):
199
196
self .check_func (lambda x : x .str .rsplit (expand = True ))
200
197
198
+ self .check_func_on_series (lambda x : repr (x .str .rsplit ("-" , n = 1 , expand = True )), pser )
199
+
201
200
def test_string_translate (self ):
202
201
m = str .maketrans ({"a" : "X" , "e" : "Y" , "i" : None })
203
202
self .check_func (lambda x : x .str .translate (m ))
0 commit comments