spark git commit: [SPARK-21658][SQL][PYSPARK] Revert "[] Add default None for value in na.replace in PySpark"
Repository: spark Updated Branches: refs/heads/branch-2.3 be3de8791 -> 45f0f4ff7 [SPARK-21658][SQL][PYSPARK] Revert "[] Add default None for value in na.replace in PySpark" This reverts commit 0fcde87aadc9a92e138f11583119465ca4b5c518. 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 https://github.com/apache/spark/pull/16793 Author: hyukjinkwon Closes #20496 from HyukjinKwon/revert-SPARK-21658. (cherry picked from commit 551dff2bccb65e9b3f77b986f167aec90d9a6016) Signed-off-by: gatorsmile Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/45f0f4ff Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/45f0f4ff Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/45f0f4ff Branch: refs/heads/branch-2.3 Commit: 45f0f4ff76accab3387b08b3773a0b127333ea3a Parents: be3de87 Author: hyukjinkwon Authored: Sat Feb 3 10:40:21 2018 -0800 Committer: gatorsmile Committed: Sat Feb 3 10:40:29 2018 -0800 -- python/pyspark/sql/dataframe.py | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/spark/blob/45f0f4ff/python/pyspark/sql/dataframe.py -- diff --git a/python/pyspark/sql/dataframe.py b/python/pyspark/sql/dataframe.py index 1496cba..2e55407 100644 --- a/python/pyspark/sql/dataframe.py +++ b/python/pyspark/sql/dataframe.py @@ -1577,16 +1577,6 @@ class DataFrame(object): |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 @@ class DataFrameNaFunctions(object): 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__ - To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org
spark git commit: [SPARK-21658][SQL][PYSPARK] Revert "[] Add default None for value in na.replace in PySpark"
Repository: spark Updated Branches: refs/heads/master 4aaa7d40b -> 551dff2bc [SPARK-21658][SQL][PYSPARK] Revert "[] Add default None for value in na.replace in PySpark" This reverts commit 0fcde87aadc9a92e138f11583119465ca4b5c518. 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 https://github.com/apache/spark/pull/16793 Author: hyukjinkwon Closes #20496 from HyukjinKwon/revert-SPARK-21658. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/551dff2b Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/551dff2b Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/551dff2b Branch: refs/heads/master Commit: 551dff2bccb65e9b3f77b986f167aec90d9a6016 Parents: 4aaa7d4 Author: hyukjinkwon Authored: Sat Feb 3 10:40:21 2018 -0800 Committer: gatorsmile Committed: Sat Feb 3 10:40:21 2018 -0800 -- python/pyspark/sql/dataframe.py | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/spark/blob/551dff2b/python/pyspark/sql/dataframe.py -- diff --git a/python/pyspark/sql/dataframe.py b/python/pyspark/sql/dataframe.py index 1496cba..2e55407 100644 --- a/python/pyspark/sql/dataframe.py +++ b/python/pyspark/sql/dataframe.py @@ -1577,16 +1577,6 @@ class DataFrame(object): |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 @@ class DataFrameNaFunctions(object): 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__ - To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org