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


##########
python/pyspark/sql/functions.py:
##########
@@ -3262,7 +3262,19 @@ 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:
+@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:
   Great ideas. I implemented these in 0bdd92b. Black formatting pushed the 
if-else statements onto three lines, which I thought was less readable. I 
changed the formatting a bit to help with readability.



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