[SPARK-58214][PYTHON] Consolidate VALUE_NOT_PEARSON into VALUE_NOT_ALLOWED#57366
Closed
zhengruifeng wants to merge 2 commits into
Closed
[SPARK-58214][PYTHON] Consolidate VALUE_NOT_PEARSON into VALUE_NOT_ALLOWED#57366zhengruifeng wants to merge 2 commits into
zhengruifeng wants to merge 2 commits into
Conversation
HyukjinKwon
approved these changes
Jul 20, 2026
zhengruifeng
marked this pull request as ready for review
July 21, 2026 00:10
Yicong-Huang
approved these changes
Jul 21, 2026
zhengruifeng
added a commit
that referenced
this pull request
Jul 21, 2026
…LOWED ### 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> (cherry picked from commit 78aa3e0) Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Consolidate the specialized PySpark
VALUE_NOT_PEARSONerror condition intoVALUE_NOT_ALLOWED. Classic and Spark ConnectDataFrame.stat.corrnow report the generic condition whenmethodis notpearson. The Spark Connect statistics test asserts the new condition.Why are the changes needed?
VALUE_NOT_PEARSONonly 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 useVALUE_NOT_ALLOWEDand its generic message. The exception type remainsPySparkValueError.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)