You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "LuciferYang (via GitHub)" <gi...@apache.org> on 2023/09/28 08:53:11 UTC

[GitHub] [spark] LuciferYang commented on a diff in pull request #43168: [SPARK-45370][PYTHON][TESTS] Fix python test when ansi mode enabled

LuciferYang commented on code in PR #43168:
URL: https://github.com/apache/spark/pull/43168#discussion_r1339767469


##########
python/pyspark/sql/functions.py:
##########
@@ -11788,50 +11788,54 @@ def array(
     Example 1: Basic usage of array function with column names.
 
     >>> from pyspark.sql import functions as sf
-    >>> df = spark.createDataFrame([("Alice", 2), ("Bob", 5)], ("name", "age"))
-    >>> df.select(sf.array('name', 'age').alias("arr")).show()
-    +----------+
-    |       arr|
-    +----------+
-    |[Alice, 2]|
-    |  [Bob, 5]|
-    +----------+
+    >>> df = spark.createDataFrame([("Alice", "doctor"), ("Bob", "engineer")],
+    ...     ("name", "occupation"))
+    >>> df.select(sf.array('name', 'occupation').alias("arr")).show()

Review Comment:
   made me feel a bit surprised, cc @zhengruifeng @HyukjinKwon 



-- 
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