Repository: spark Updated Branches: refs/heads/branch-2.0 fb944a1e8 -> 28bb2b044
[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. (cherry picked from commit 47f5b88db4d65f1870b16745d3c93d01051ba20b) Signed-off-by: Sean Owen <so...@cloudera.com> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/28bb2b04 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/28bb2b04 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/28bb2b04 Branch: refs/heads/branch-2.0 Commit: 28bb2b0447e9b47c4c568de983adde4a49b29263 Parents: fb944a1 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:18 2016 +0100 ---------------------------------------------------------------------- python/pyspark/sql/dataframe.py | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/28bb2b04/python/pyspark/sql/dataframe.py ---------------------------------------------------------------------- diff --git a/python/pyspark/sql/dataframe.py b/python/pyspark/sql/dataframe.py index b9f50ff..6aff938 100644 --- a/python/pyspark/sql/dataframe.py +++ b/python/pyspark/sql/dataframe.py @@ -1376,6 +1376,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. @@ -1389,6 +1390,7 @@ class DataFrame(object): @ignore_unicode_prefix def drop(self, col): """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 col: a string name of the column to drop, or a :class:`Column` to drop. --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org