[SPARK-58402][PYTHON] Consolidate UNKNOWN_EXPLAIN_MODE into VALUE_NOT_ALLOWED - #57594
Closed
zhengruifeng wants to merge 1 commit into
Closed
[SPARK-58402][PYTHON] Consolidate UNKNOWN_EXPLAIN_MODE into VALUE_NOT_ALLOWED#57594zhengruifeng wants to merge 1 commit into
zhengruifeng wants to merge 1 commit into
Conversation
zhengruifeng
marked this pull request as ready for review
July 28, 2026 08:17
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>
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 Spark Connect
UNKNOWN_EXPLAIN_MODEerror condition intoVALUE_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_MODEduplicates 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_ALLOWEDand its generic message. The exception type remainsPySparkValueError.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)