You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "wunderalbert (via GitHub)" <gi...@apache.org> on 2024/02/22 14:20:07 UTC

Re: [PR] [SPARK-47132][DOCS][PYTHON] Correct docstring for pyspark's dataframe.head [spark]

wunderalbert commented on code in PR #45197:
URL: https://github.com/apache/spark/pull/45197#discussion_r1499320875


##########
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:
   Good point. I'm suggesting adding this as an example, and extending the `returns` section to mention the length of the list (see commit below).



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