zhengruifeng commented on code in PR #41296:
URL: https://github.com/apache/spark/pull/41296#discussion_r1204909613
##########
python/pyspark/sql/functions.py:
##########
@@ -6594,20 +6594,28 @@ def substring_index(str: "ColumnOrName", delim: str,
count: int) -> Column:
@try_remote_functions
-def levenshtein(left: "ColumnOrName", right: "ColumnOrName") -> Column:
+def levenshtein(
+ left: "ColumnOrName", right: "ColumnOrName", threshold: Optional[int] =
None
+) -> Column:
"""Computes the Levenshtein distance of the two given strings.
.. versionadded:: 1.5.0
.. versionchanged:: 3.4.0
Supports Spark Connect.
+ .. versionchanged:: 3.5.0
+ Supports Spark Connect.
Review Comment:
I prefer another `versionadded ` after parameter `threshold`, you can refer
to
https://github.com/apache/spark/blob/ab4693d979b4879ca07268e3719c20a5088e87ec/python/pyspark/sql/pandas/map_ops.py#L55-L67
##########
python/pyspark/sql/tests/connect/test_connect_function.py:
##########
@@ -1920,10 +1920,16 @@ def test_string_functions_multi_args(self):
cdf.select(CF.substring_index(cdf.e, ".", 2)).toPandas(),
sdf.select(SF.substring_index(sdf.e, ".", 2)).toPandas(),
)
+
Review Comment:
```suggestion
```
--
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]