zero323 commented on code in PR #37329:
URL: https://github.com/apache/spark/pull/37329#discussion_r949968025


##########
python/pyspark/sql/functions.py:
##########
@@ -3262,18 +3262,49 @@ def regexp_extract(str: "ColumnOrName", pattern: str, 
idx: int) -> Column:
     return _invoke_function("regexp_extract", _to_java_column(str), pattern, 
idx)
 
 
-def regexp_replace(str: "ColumnOrName", pattern: str, replacement: str) -> 
Column:
-    r"""Replace all substrings of the specified string value that match regexp 
with rep.
+@overload
+def regexp_replace(string: "ColumnOrName", pattern: str, replacement: str) -> 
Column:
+    ...
+
+
+@overload
+def regexp_replace(string: "ColumnOrName", pattern: Column, replacement: 
Column) -> Column:
+    ...
+
+
+def regexp_replace(
+    string: "ColumnOrName", pattern: Union[str, Column], replacement: 
Union[str, Column]

Review Comment:
   Nit. With the latest changes we can drop overloaded signatures and keep only
   
   ```python
   def regexp_replace(
       string: "ColumnOrName", pattern: Union[str, Column], replacement: 
Union[str, Column]
   ) -> Column: 
   ```
   
   Otherwise LGTM



-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to