Skip to content
Permalink
Browse files

[SPARK-21658][SQL][PYSPARK] Revert "[] Add default None for value in …

…na.replace in PySpark"

This reverts commit 0fcde87.

See the discussion in [SPARK-21658](https://issues.apache.org/jira/browse/SPARK-21658),  [SPARK-19454](https://issues.apache.org/jira/browse/SPARK-19454) and #16793

Author: hyukjinkwon <gurwls223@gmail.com>

Closes #20496 from HyukjinKwon/revert-SPARK-21658.

(cherry picked from commit 551dff2)
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
  • Loading branch information...
HyukjinKwon authored and gatorsmile committed Feb 3, 2018
1 parent be3de87 commit 45f0f4ff76accab3387b08b3773a0b127333ea3a
Showing with 1 addition and 11 deletions.
  1. +1 −11 python/pyspark/sql/dataframe.py
@@ -1577,16 +1577,6 @@ def replace(self, to_replace, value=None, subset=None):
|null| null|null|
+----+------+----+
>>> df4.na.replace('Alice').show()
+----+------+----+
| age|height|name|
+----+------+----+
| 10| 80|null|
| 5| null| Bob|
|null| null| Tom|
|null| null|null|
+----+------+----+
>>> df4.na.replace(['Alice', 'Bob'], ['A', 'B'], 'name').show()
+----+------+----+
| age|height|name|
@@ -2055,7 +2045,7 @@ def fill(self, value, subset=None):

fill.__doc__ = DataFrame.fillna.__doc__

def replace(self, to_replace, value=None, subset=None):
def replace(self, to_replace, value, subset=None):
return self.df.replace(to_replace, value, subset)

replace.__doc__ = DataFrame.replace.__doc__

0 comments on commit 45f0f4f

Please sign in to comment.
You can’t perform that action at this time.