Skip to content

Commit

Permalink
[SPARK-21658][SQL][PYSPARK] Revert "[] Add default None for value in …
Browse files Browse the repository at this point in the history
…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 <[email protected]>

Closes #20496 from HyukjinKwon/revert-SPARK-21658.
  • Loading branch information
HyukjinKwon authored and gatorsmile committed Feb 3, 2018
1 parent 4aaa7d4 commit 551dff2
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions python/pyspark/sql/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down Expand Up @@ -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__
Expand Down

0 comments on commit 551dff2

Please sign in to comment.