Skip to content

Commit

Permalink
[SPARK-16651][PYSPARK][DOC] Make withColumnRenamed/drop description…
Browse files Browse the repository at this point in the history
… 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 <[email protected]>

Closes apache#14288 from dongjoon-hyun/SPARK-16651.
  • Loading branch information
dongjoon-hyun authored and srowen committed Jul 22, 2016
1 parent 6c56fff commit 47f5b88
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/pyspark/sql/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,7 @@ def withColumn(self, colName, col):
@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.
Expand All @@ -1401,6 +1402,7 @@ def withColumnRenamed(self, existing, new):
@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.
Expand Down

0 comments on commit 47f5b88

Please sign in to comment.