-
Notifications
You must be signed in to change notification settings - Fork 28.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-50753][PYTHON] Add CachedAccessor for PySpark Plotting #49394
base: master
Are you sure you want to change the base?
Conversation
2cbc4de
to
420b86d
Compare
420b86d
to
c532020
Compare
T = TypeVar("T") | ||
|
||
|
||
class CachedAccessor(Generic[T]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will be a followup to consolidate CachedAccessors between the Pandas API on Spark and the one here
>>> df.plot(kind="line", x="category", y=["int_val", "float_val"]) # doctest: +SKIP | ||
""" | ||
... | ||
plot: CachedAccessor = CachedAccessor("plot", "pyspark.sql.plot.core.PySparkPlotAccessor") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!
What changes were proposed in this pull request?
Add CachedAccessor for PySpark Plotting.
Why are the changes needed?
Previously,
plot
is defined as a property:This caused an issue where Sphinx, the documentation generator, could not recognize its chaining methods (e.g., bar, barh, etc.). As a result, it failed to populate the documentation for the available plot methods.
It should reach parity with Pandas API on Spark
Does this PR introduce any user-facing change?
No user-facing changes.
From
TO
How was this patch tested?
Existing tests.
Was this patch authored or co-authored using generative AI tooling?
No.