amaliujia commented on code in PR #38836:
URL: https://github.com/apache/spark/pull/38836#discussion_r1035501362


##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -1050,6 +1055,137 @@ def dropna(
             session=self._session,
         )
 
+    def replace(
+        self,
+        to_replace: Union[
+            "LiteralType", List["LiteralType"], Dict["LiteralType", 
"OptionalPrimitiveType"]
+        ],
+        value: Optional[
+            Union["OptionalPrimitiveType", List["OptionalPrimitiveType"], 
_NoValueType]
+        ] = _NoValue,
+        subset: Optional[List[str]] = None,
+    ) -> "DataFrame":
+        """Returns a new :class:`DataFrame` replacing a value with another 
value.
+        :func:`DataFrame.replace` and :func:`DataFrameNaFunctions.replace` are
+        aliases of each other.
+        Values to_replace and value must have the same type and can only be 
numerics, booleans,
+        or strings. Value can have None. When replacing, the new value will be 
cast
+        to the type of the existing column.
+        For numeric replacements all values to be replaced should have unique
+        floating point representation. In case of conflicts (for example with 
`{42: -1, 42.0: 1}`)
+        and arbitrary replacement will be used.
+
+        .. versionadded:: 3.4.0

Review Comment:
   @HyukjinKwon made a good point that given entire Connect is added since 3.4, 
we probably do not need repeat adding this on every API but just have a package 
level `versionadded`



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