You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xinrong Meng (Jira)" <ji...@apache.org> on 2025/02/07 01:24:00 UTC

[jira] [Updated] (SPARK-50753) Add pyspark plotting to API documentation

     [ https://issues.apache.org/jira/browse/SPARK-50753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xinrong Meng updated SPARK-50753:
---------------------------------
    Component/s: Documentation

> Add pyspark plotting to API documentation
> -----------------------------------------
>
>                 Key: SPARK-50753
>                 URL: https://issues.apache.org/jira/browse/SPARK-50753
>             Project: Spark
>          Issue Type: Sub-task
>          Components: Documentation, PySpark
>    Affects Versions: 4.0.0
>            Reporter: Xinrong Meng
>            Priority: Major
>              Labels: pull-request-available
>
> Previously, the plot property in PySpark DataFrame was simply a placeholder:
> ```py
> >>> from pyspark.sql import DataFrame
> >>> DataFrame.plot
> <property object at 0x10543fd60>
> >>> dir(DataFrame.plot)
> ['__class__', ... 'getter', 'setter']
> ```
> This caused an issue where Sphinx, the documentation generator, could not recognize the chaining methods (e.g., bar, barh, etc.) provided by the plot accessor. As a result, it failed to populate the documentation for the available plot methods.
> We aim to bring PySpark’s plot accessor to parity with the Pandas API on Spark
> ```py
> >>> import pyspark.pandas as ps
> >>> ps.DataFrame.plot
> <class 'pyspark.pandas.plot.core.PandasOnSparkPlotAccessor'>
> ```
> The plot property in PySpark DataFrame should look like this
> ```py
> >>> from pyspark.sql import DataFrame
> >>> DataFrame.plot
> <pyspark.sql.plot.core.PySparkPlotAccessor object at 0x10500b070>
> >>> dir(DataFrame.plot)
> ['__call__', ..., '_backends', '_get_plot_backend', 'area', 'bar', 'barh', 'box', 'data', 'hist', 'kde', 'line', 'pie', 'plot_data_map', 'scatter']
> ```



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