Skip to content

Commit 45f0f4f

Browse files
HyukjinKwongatorsmile
authored andcommitted
[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 <[email protected]> Closes #20496 from HyukjinKwon/revert-SPARK-21658. (cherry picked from commit 551dff2) Signed-off-by: gatorsmile <[email protected]>
1 parent be3de87 commit 45f0f4f

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

python/pyspark/sql/dataframe.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,16 +1577,6 @@ def replace(self, to_replace, value=None, subset=None):
15771577
|null| null|null|
15781578
+----+------+----+
15791579
1580-
>>> df4.na.replace('Alice').show()
1581-
+----+------+----+
1582-
| age|height|name|
1583-
+----+------+----+
1584-
| 10| 80|null|
1585-
| 5| null| Bob|
1586-
|null| null| Tom|
1587-
|null| null|null|
1588-
+----+------+----+
1589-
15901580
>>> df4.na.replace(['Alice', 'Bob'], ['A', 'B'], 'name').show()
15911581
+----+------+----+
15921582
| age|height|name|
@@ -2055,7 +2045,7 @@ def fill(self, value, subset=None):
20552045

20562046
fill.__doc__ = DataFrame.fillna.__doc__
20572047

2058-
def replace(self, to_replace, value=None, subset=None):
2048+
def replace(self, to_replace, value, subset=None):
20592049
return self.df.replace(to_replace, value, subset)
20602050

20612051
replace.__doc__ = DataFrame.replace.__doc__

0 commit comments

Comments
 (0)