This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 82e091ef270 Revert "[SPARK-43476][PYTHON][TESTS] Enable 
SeriesStringTests.test_string_replace for pandas 2.0.0"
82e091ef270 is described below

commit 82e091ef2707a349b322f011d8cab9bcae6d9638
Author: Hyukjin Kwon <[email protected]>
AuthorDate: Wed Jul 5 09:03:28 2023 +0900

    Revert "[SPARK-43476][PYTHON][TESTS] Enable 
SeriesStringTests.test_string_replace for pandas 2.0.0"
    
    This reverts commit 442fdb8be42789d9a3fac8361f339f4e2a304fb8.
---
 python/pyspark/pandas/tests/test_series_string.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/python/pyspark/pandas/tests/test_series_string.py 
b/python/pyspark/pandas/tests/test_series_string.py
index 956567bc5a4..3c2bd58da1a 100644
--- a/python/pyspark/pandas/tests/test_series_string.py
+++ b/python/pyspark/pandas/tests/test_series_string.py
@@ -246,6 +246,10 @@ class SeriesStringTestsMixin:
         with self.assertRaises(TypeError):
             self.check_func(lambda x: x.str.repeat(repeats=[0, 1, 2, 3, 4, 5, 
6, 7, 8, 9]))
 
+    @unittest.skipIf(
+        LooseVersion(pd.__version__) >= LooseVersion("2.0.0"),
+        "TODO(SPARK-43476): Enable SeriesStringTests.test_string_replace for 
pandas 2.0.0.",
+    )
     def test_string_replace(self):
         self.check_func(lambda x: x.str.replace("a.", "xx", regex=True))
         self.check_func(lambda x: x.str.replace("a.", "xx", regex=False))
@@ -255,11 +259,10 @@ class SeriesStringTestsMixin:
         def repl(m):
             return m.group(0)[::-1]
 
-        regex_pat = re.compile(r"[a-z]+")
-        self.check_func(lambda x: x.str.replace(regex_pat, repl, regex=True))
+        self.check_func(lambda x: x.str.replace(r"[a-z]+", repl))
         # compiled regex with flags
         regex_pat = re.compile(r"WHITESPACE", flags=re.IGNORECASE)
-        self.check_func(lambda x: x.str.replace(regex_pat, "---", regex=True))
+        self.check_func(lambda x: x.str.replace(regex_pat, "---"))
 
     def test_string_rfind(self):
         self.check_func(lambda x: x.str.rfind("a"))


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to