Commit bc54a3f
[SPARK-37730][PYTHON] Replace use of MPLPlot._add_legend_handle with MPLPlot._append_legend_handles_labels
### What changes were proposed in this pull request?
Replace use of MPLPlot._add_legend_handle (removed in pandas) with MPLPlot._append_legend_handles_labels in histogram and KDE plots.
Based on: pandas-dev/pandas@029907c
### Why are the changes needed?
Fix of SPARK-37730. plot.hist and plot.kde don't throw AttributeError for pandas=1.3.5.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
~~Tested with existing plot test on CI (for older pandas only).~~ (it seems that CI doesn't run matplotlib tests, see #35000 (comment))
I've run tests on a local computer, see #35000 (comment) :
```
$ python python/pyspark/pandas/tests/plot/test_series_plot_matplotlib.py
```
:question: **QUESTION:** Maybe add plot testing for pandas 1.3.5 on CI? (I've noticed that CI uses `pandas=1.3.4`, maybe update it to `1.3.5`?)
Closes #35000 from mslapek/fixpythonplot.
Authored-by: Michał Słapek <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
(cherry picked from commit 371e307)
Signed-off-by: Dongjoon Hyun <[email protected]>1 parent c5983c1 commit bc54a3f
1 file changed
+20
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
395 | 401 | | |
396 | 402 | | |
397 | 403 | | |
| |||
400 | 406 | | |
401 | 407 | | |
402 | 408 | | |
403 | | - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
404 | 413 | | |
405 | 414 | | |
406 | 415 | | |
| |||
483 | 492 | | |
484 | 493 | | |
485 | 494 | | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
486 | 501 | | |
487 | 502 | | |
488 | 503 | | |
| |||
491 | 506 | | |
492 | 507 | | |
493 | 508 | | |
494 | | - | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
495 | 513 | | |
496 | 514 | | |
497 | 515 | | |
| |||
0 commit comments