Repository: spark
Updated Branches:
  refs/heads/master 6c56fff11 -> 47f5b88db


[SPARK-16651][PYSPARK][DOC] Make `withColumnRenamed/drop` description more 
consistent with Scala API

## What changes were proposed in this pull request?

`withColumnRenamed` and `drop` is a no-op if the given column name does not 
exists. Python documentation also describe that, but this PR adds more explicit 
line consistently with Scala to reduce the ambiguity.

## How was this patch tested?

It's about docs.

Author: Dongjoon Hyun <dongj...@apache.org>

Closes #14288 from dongjoon-hyun/SPARK-16651.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/47f5b88d
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/47f5b88d
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/47f5b88d

Branch: refs/heads/master
Commit: 47f5b88db4d65f1870b16745d3c93d01051ba20b
Parents: 6c56fff
Author: Dongjoon Hyun <dongj...@apache.org>
Authored: Fri Jul 22 13:20:06 2016 +0100
Committer: Sean Owen <so...@cloudera.com>
Committed: Fri Jul 22 13:20:06 2016 +0100

----------------------------------------------------------------------
 python/pyspark/sql/dataframe.py | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/47f5b88d/python/pyspark/sql/dataframe.py
----------------------------------------------------------------------
diff --git a/python/pyspark/sql/dataframe.py b/python/pyspark/sql/dataframe.py
index 8ff9403..0cbb3ad 100644
--- a/python/pyspark/sql/dataframe.py
+++ b/python/pyspark/sql/dataframe.py
@@ -1388,6 +1388,7 @@ class DataFrame(object):
     @since(1.3)
     def withColumnRenamed(self, existing, new):
         """Returns a new :class:`DataFrame` by renaming an existing column.
+        This is a no-op if schema doesn't contain the given column name.
 
         :param existing: string, name of the existing column to rename.
         :param col: string, new name of the column.
@@ -1401,6 +1402,7 @@ class DataFrame(object):
     @ignore_unicode_prefix
     def drop(self, *cols):
         """Returns a new :class:`DataFrame` that drops the specified column.
+        This is a no-op if schema doesn't contain the given column name(s).
 
         :param cols: a string name of the column to drop, or a
             :class:`Column` to drop, or a list of string name of the columns 
to drop.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to