xinrong-meng commented on code in PR #49394:
URL: https://github.com/apache/spark/pull/49394#discussion_r1906911125
##########
python/pyspark/sql/dataframe.py:
##########
@@ -6794,35 +6793,7 @@ def executionInfo(self) -> Optional["ExecutionInfo"]:
"""
...
- @property
- def plot(self) -> "PySparkPlotAccessor":
- """
- Returns a :class:`PySparkPlotAccessor` for plotting functions.
-
- .. versionadded:: 4.0.0
-
- Returns
- -------
- :class:`PySparkPlotAccessor`
-
- Notes
- -----
- This API is experimental.
- It provides two ways to create plots:
- 1. Chaining style (e.g., `df.plot.line(...)`).
- 2. Explicit style (e.g., `df.plot(kind="line", ...)`).
-
- Examples
- --------
- >>> data = [("A", 10, 1.5), ("B", 30, 2.5), ("C", 20, 3.5)]
- >>> columns = ["category", "int_val", "float_val"]
- >>> df = spark.createDataFrame(data, columns)
- >>> type(df.plot)
- <class 'pyspark.sql.plot.core.PySparkPlotAccessor'>
- >>> df.plot.line(x="category", y=["int_val", "float_val"]) # doctest:
+SKIP
- >>> df.plot(kind="line", x="category", y=["int_val", "float_val"]) #
doctest: +SKIP
- """
- ...
+ plot: CachedAccessor = CachedAccessor("plot",
"pyspark.sql.plot.core.PySparkPlotAccessor")
Review Comment:
That lazy import fails doc generation
```
Warning, treated as error:
autodoc: failed to import class 'plot' from module 'DataFrame'; the
following exception was raised:
No module named 'DataFrame'
make: *** [Makefile:35: html] Error 2
```
@HyukjinKwon @itholic do you happen to know how to work around this? Thank
you!
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]