Skip to content

[SPARK-58214][PYTHON] Consolidate VALUE_NOT_PEARSON into VALUE_NOT_ALLOWED#57366

Closed
zhengruifeng wants to merge 2 commits into
apache:masterfrom
zhengruifeng:value-not-allowed-dev1
Closed

[SPARK-58214][PYTHON] Consolidate VALUE_NOT_PEARSON into VALUE_NOT_ALLOWED#57366
zhengruifeng wants to merge 2 commits into
apache:masterfrom
zhengruifeng:value-not-allowed-dev1

Conversation

@zhengruifeng

@zhengruifeng zhengruifeng commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

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)

@zhengruifeng zhengruifeng changed the title [WIP][PYTHON] Use VALUE_NOT_ALLOWED for corr [WIP][PYTHON] Consolidate VALUE_NOT_PEARSON into VALUE_NOT_ALLOWED Jul 20, 2026
@zhengruifeng zhengruifeng changed the title [WIP][PYTHON] Consolidate VALUE_NOT_PEARSON into VALUE_NOT_ALLOWED [SPARK-58214][PYTHON] Consolidate VALUE_NOT_PEARSON into VALUE_NOT_ALLOWED Jul 20, 2026
@zhengruifeng
zhengruifeng marked this pull request as ready for review July 21, 2026 00:10
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>
@zhengruifeng

Copy link
Copy Markdown
Contributor Author

Merge Summary:

Posted by merge_spark_pr.py

@zhengruifeng
zhengruifeng deleted the value-not-allowed-dev1 branch July 21, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants