You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "itholic (via GitHub)" <gi...@apache.org> on 2023/07/03 09:13:31 UTC

[GitHub] [spark] itholic commented on a diff in pull request #41823: [SPARK-43476][PYTHON][TESTS] Enable SeriesStringTests.test_string_replace for pandas 2.0.0.

itholic commented on code in PR #41823:
URL: https://github.com/apache/spark/pull/41823#discussion_r1250536265


##########
python/pyspark/pandas/tests/test_series_string.py:
##########
@@ -259,10 +255,11 @@ def test_string_replace(self):
         def repl(m):
             return m.group(0)[::-1]
 
-        self.check_func(lambda x: x.str.replace(r"[a-z]+", repl))
+        regex_pat = re.compile(r"[a-z]+")
+        self.check_func(lambda x: x.str.replace(regex_pat, repl, regex=True))
         # compiled regex with flags
         regex_pat = re.compile(r"WHITESPACE", flags=re.IGNORECASE)
-        self.check_func(lambda x: x.str.replace(regex_pat, "---"))

Review Comment:
   Yeah, as mentioned in https://github.com/apache/spark/pull/41824/files#r1250524246, it is advisable to wait for the Spark 4.0 release and address the behavior instead of just making changes to pass the tests. Just created a new ticket SPARK-44276 in order not to forget.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org