You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Albert Ziegler (Jira)" <ji...@apache.org> on 2024/02/22 13:40:00 UTC
[jira] [Created] (SPARK-47132) Mistake in Docstring for Pyspark's Dataframe.head()
Albert Ziegler created SPARK-47132:
--------------------------------------
Summary: Mistake in Docstring for Pyspark's Dataframe.head()
Key: SPARK-47132
URL: https://issues.apache.org/jira/browse/SPARK-47132
Project: Spark
Issue Type: Bug
Components: PySpark
Affects Versions: 3.5.0
Reporter: Albert Ziegler
The docstring claims that {{head(n)}} would return a {{Row}} (rather than a list of rows) iff n == 1, but that's incorrect.
Type hints, example, and implementation show that the difference between row or list of rows lies in whether n is supplied at all -- if it isn't, {{head()}} returns a {{{}Row{}}}, if it is, even if it is 1, {{head(n)}} returns a list.
A suggestion to fix is here: https://github.com/apache/spark/pull/45197
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org