aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDongjoon Hyun <dongjoon@apache.org>2016-07-22 13:20:06 +0100
committerSean Owen <sowen@cloudera.com>2016-07-22 13:20:06 +0100
commit47f5b88db4d65f1870b16745d3c93d01051ba20b (patch)
tree0abd2bd277628e5e27f57a5998c4f356dd1cc256 /python
parent6c56fff118ff2380c661456755db17976040de66 (diff)
downloadspark-47f5b88db4d65f1870b16745d3c93d01051ba20b.tar.gz
spark-47f5b88db4d65f1870b16745d3c93d01051ba20b.tar.bz2
spark-47f5b88db4d65f1870b16745d3c93d01051ba20b.zip
[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 <dongjoon@apache.org> Closes #14288 from dongjoon-hyun/SPARK-16651.
Diffstat (limited to 'python')
-rw-r--r--python/pyspark/sql/dataframe.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/python/pyspark/sql/dataframe.py b/python/pyspark/sql/dataframe.py
index 8ff9403d59..0cbb3adfa8 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.