Commit 9831552
[SPARK-52047][PYTHON] Raise PySparkValueError for unsupported plot kinds
### What changes were proposed in this pull request?
Raise PySparkValueError for unsupported plot kinds
### Why are the changes needed?
Previously, unsupported plot kinds raised a raw KeyError, which was unclear. This change adds explicit validation and raises a descriptive PySparkValueError, improving user experience and debugging clarity.
### Does this PR introduce _any_ user-facing change?
Yes, when passing an invalid kind to DataFrame.plot, users now receive a clear PySparkValueError instead of a generic KeyError.
### How was this patch tested?
Unit tests.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes apache#50837 from xinrong-meng/plot_test.
Authored-by: Xinrong Meng <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>1 parent 1cec856 commit 9831552
File tree
3 files changed
+40
-1
lines changed- python/pyspark
- errors
- sql
- plot
- tests/plot
3 files changed
+40
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1155 | 1155 | | |
1156 | 1156 | | |
1157 | 1157 | | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
1158 | 1163 | | |
1159 | 1164 | | |
1160 | 1165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
46 | 59 | | |
47 | 60 | | |
48 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
51 | 73 | | |
52 | 74 | | |
53 | | - | |
54 | 75 | | |
55 | 76 | | |
56 | 77 | | |
| |||
0 commit comments