xinrong-meng commented on code in PR #45197:
URL: https://github.com/apache/spark/pull/45197#discussion_r1498150767


##########
python/pyspark/sql/dataframe.py:
##########
@@ -3526,8 +3526,8 @@ def head(self, n: Optional[int] = None) -> 
Union[Optional[Row], List[Row]]:
 
         Returns
         -------
-        If n is greater than 1, return a list of :class:`Row`.
-        If n is 1, return a single Row.
+        If n is supplied, return a list of :class:`Row`.

Review Comment:
   ```py
   >>> spark.range(3).head(0)
   []
   ```
   I'm wondering if we should call out the empty list when `n=0`.



-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to