You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/08/16 06:30:04 UTC

[GitHub] [spark] dcoliversun commented on a diff in pull request #37521: [SPARK-40078][PYTHON][DOCS] Make pyspark.sql.column examples self-contained

dcoliversun commented on code in PR #37521:
URL: https://github.com/apache/spark/pull/37521#discussion_r946382539


##########
python/pyspark/sql/column.py:
##########
@@ -187,18 +187,26 @@ class Column:
     """
     A column in a DataFrame.
 
-    :class:`Column` instances can be created by::
+    .. versionadded:: 1.3.0
 
-        # 1. Select a column out of a DataFrame
+    Examples
+    --------
+    :class:`Column` instances can be created by::
 
-        df.colName
-        df["colName"]
+    >>> df = spark.createDataFrame(
+    ...      [(2, "Alice"), (5, "Bob")], ["age", "name"])
 
-        # 2. Create from an expression
-        df.colName + 1
-        1 / df.colName
+    1. Select a column out of a DataFrame
+    >>> df.name
+    Column<'name'>
+    >>> df["name"]
+    Column<'name'>
 
-    .. versionadded:: 1.3.0
+    2. Create from an expression

Review Comment:
   Thanks, updated in latest commit. Let's see result.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org