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

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

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


##########
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:
   Actually, I think we should also make the behaviour the same with pandas 2.0.0 at pandas API on Spark too. I forgot how we concluded this. Right @itholic ? and should upgrade migration guide too?



-- 
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