This is an automated email from the ASF dual-hosted git repository. dongjoon pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new 56fa1e906583 [MINOR][PYTHON][DOCS] Correct the examples of `toPandas` and `toArrow` 56fa1e906583 is described below commit 56fa1e90658371b47d5da44c838bbf5c70b77f4f Author: Ruifeng Zheng <ruife...@apache.org> AuthorDate: Tue Sep 16 12:19:08 2025 -0700 [MINOR][PYTHON][DOCS] Correct the examples of `toPandas` and `toArrow` ### What changes were proposed in this pull request? Correct the examples of `toPandas` and `toArrow` ### Why are the changes needed? they are not copy-pastable, and the example of `toArrow` is not correct ### Does this PR introduce _any_ user-facing change? doc-change ### How was this patch tested? manually check, the doc-tests are skipped due to pandas/pyarrow dependency ### Was this patch authored or co-authored using generative AI tooling? no Closes #52353 from zhengruifeng/fix_example_toxxx. Authored-by: Ruifeng Zheng <ruife...@apache.org> Signed-off-by: Dongjoon Hyun <dongj...@apache.org> --- python/pyspark/sql/dataframe.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/pyspark/sql/dataframe.py b/python/pyspark/sql/dataframe.py index 675d972e3ef5..fca83c165b1d 100644 --- a/python/pyspark/sql/dataframe.py +++ b/python/pyspark/sql/dataframe.py @@ -6510,13 +6510,14 @@ class DataFrame: Examples -------- + >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.toArrow() # doctest: +SKIP pyarrow.Table age: int64 name: string ---- - age: [[2,5]] - name: [["Alice","Bob"]] + age: [[2],[5]] + name: [["Alice"],["Bob"]] """ ... @@ -6540,6 +6541,7 @@ class DataFrame: Examples -------- + >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.toPandas() # doctest: +SKIP age name 0 2 Alice --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org