uros-b commented on code in PR #56533:
URL: https://github.com/apache/spark/pull/56533#discussion_r3441340289


##########
python/pyspark/pandas/tests/series/test_string_ops_adv.py:
##########
@@ -86,6 +86,20 @@ def test_string_findall(self):
                 lambda x: x.str.findall("wh.*", flags=re.IGNORECASE), 
self.pser, ignore_null=True
             )
 
+        pser = pd.Series(["abc-123 def-456", "no match", None])
+        pattern = "([a-z]+)-([0-9]+)"
+
+        def normalize_matches(matches):  # type: ignore[no-untyped-def]
+            if isinstance(matches, (list, np.ndarray)):
+                return [list(match) for match in matches]
+            return matches
+
+        expected = pser.str.findall(pattern).map(normalize_matches)
+        actual = ps.from_pandas(pser).str.findall(pattern).to_pandas()
+        self.assertIsNone(actual.iloc[-1])
+        actual = actual.map(normalize_matches)
+        self.assert_eq(actual, expected)
+

Review Comment:
   Nit: the new test is hand-rolled, if possible - please try to align with the 
rest of the suite (e.g. use existing helpers like `check_func_on_series`).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to