Commit 78aa3e0
committed
[SPARK-58214][PYTHON] Consolidate VALUE_NOT_PEARSON into VALUE_NOT_ALLOWED
### What changes were proposed in this pull request?
Consolidate the specialized PySpark `VALUE_NOT_PEARSON` error condition into `VALUE_NOT_ALLOWED`. Classic and Spark Connect `DataFrame.stat.corr` now report the generic condition when `method` is not `pearson`. The Spark Connect statistics test asserts the new condition.
### Why are the changes needed?
`VALUE_NOT_PEARSON` only represents a single allowed argument value and duplicates the generic allowed-values condition. Removing it reduces narrowly scoped error conditions and aligns the validation with other PySpark APIs.
### Does this PR introduce _any_ user-facing change?
Yes. Invalid `DataFrame.stat.corr(..., method=...)` calls now use `VALUE_NOT_ALLOWED` and its generic message. The exception type remains `PySparkValueError`.
### How was this patch tested?
Updated the Spark Connect statistics test assertion. The focused PySpark test suite was not run.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Codex (GPT-5)
Closes #57366 from zhengruifeng/value-not-allowed-dev1.
Authored-by: Ruifeng Zheng <ruifengz@apache.org>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>1 parent 2347165 commit 78aa3e0
4 files changed
Lines changed: 12 additions & 16 deletions
File tree
- python/pyspark
- errors
- sql
- classic
- connect
- tests/connect
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1208 | 1208 | | |
1209 | 1209 | | |
1210 | 1210 | | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
1214 | | - | |
1215 | | - | |
1216 | 1211 | | |
1217 | 1212 | | |
1218 | 1213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1693 | 1693 | | |
1694 | 1694 | | |
1695 | 1695 | | |
1696 | | - | |
1697 | | - | |
| 1696 | + | |
| 1697 | + | |
1698 | 1698 | | |
1699 | 1699 | | |
1700 | 1700 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1663 | 1663 | | |
1664 | 1664 | | |
1665 | 1665 | | |
1666 | | - | |
1667 | | - | |
| 1666 | + | |
| 1667 | + | |
1668 | 1668 | | |
1669 | 1669 | | |
1670 | 1670 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
| |||
0 commit comments