Skip to content

[SPARK-58402][PYTHON] Consolidate UNKNOWN_EXPLAIN_MODE into VALUE_NOT_ALLOWED - #57594

Closed
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:consolidate-unknown-explain-mode-dev0
Closed

[SPARK-58402][PYTHON] Consolidate UNKNOWN_EXPLAIN_MODE into VALUE_NOT_ALLOWED#57594
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:consolidate-unknown-explain-mode-dev0

Conversation

@zhengruifeng

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Consolidate the specialized Spark Connect UNKNOWN_EXPLAIN_MODE error condition into VALUE_NOT_ALLOWED. Invalid explain modes now report the generic allowed-values condition, and the existing Spark Connect test asserts the new condition.

Why are the changes needed?

UNKNOWN_EXPLAIN_MODE duplicates the generic allowed-values condition for a fixed argument allowlist. Removing it reduces narrowly scoped PySpark error conditions and aligns the validation with similar APIs.

Does this PR introduce any user-facing change?

Yes. Invalid Spark Connect explain modes now use VALUE_NOT_ALLOWED and its generic message. The exception type remains PySparkValueError.

How was this patch tested?

Updated the existing Spark Connect explain-mode assertion. Static validation passed: git diff --check, JSON parsing, and a changed-Python-file line-length scan. The focused 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] Consolidate UNKNOWN_EXPLAIN_MODE into VALUE_NOT_ALLOWED [SPARK-58402][PYTHON] Consolidate UNKNOWN_EXPLAIN_MODE into VALUE_NOT_ALLOWED Jul 28, 2026
@zhengruifeng
zhengruifeng marked this pull request as ready for review July 28, 2026 08:17
@zhengruifeng
zhengruifeng requested a review from HyukjinKwon July 28, 2026 08:17

@uros-b uros-b left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @zhengruifeng!

zhengruifeng added a commit that referenced this pull request Jul 28, 2026
…_ALLOWED

### What changes were proposed in this pull request?

Consolidate the specialized Spark Connect `UNKNOWN_EXPLAIN_MODE` error condition into `VALUE_NOT_ALLOWED`. Invalid explain modes now report the generic allowed-values condition, and the existing Spark Connect test asserts the new condition.

### Why are the changes needed?

`UNKNOWN_EXPLAIN_MODE` duplicates the generic allowed-values condition for a fixed argument allowlist. Removing it reduces narrowly scoped PySpark error conditions and aligns the validation with similar APIs.

### Does this PR introduce _any_ user-facing change?

Yes. Invalid Spark Connect explain modes now use `VALUE_NOT_ALLOWED` and its generic message. The exception type remains `PySparkValueError`.

### How was this patch tested?

Updated the existing Spark Connect explain-mode assertion. Static validation passed: `git diff --check`, JSON parsing, and a changed-Python-file line-length scan. The focused test suite was not run.

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Codex (GPT-5)

Closes #57594 from zhengruifeng/consolidate-unknown-explain-mode-dev0.

Authored-by: Ruifeng Zheng <ruifengz@apache.org>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
(cherry picked from commit 2df516c)
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 consolidate-unknown-explain-mode-dev0 branch July 28, 2026 12:33
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.

2 participants