Skip to content

[SPARK-58114][PYTHON] Consolidate VALUE_NOT_ANY_OR_ALL into VALUE_NOT_ALLOWED#57236

Closed
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:consolidate-value-not-any-or-all-dev4
Closed

[SPARK-58114][PYTHON] Consolidate VALUE_NOT_ANY_OR_ALL into VALUE_NOT_ALLOWED#57236
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:consolidate-value-not-any-or-all-dev4

Conversation

@zhengruifeng

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Consolidate the specialized PySpark VALUE_NOT_ANY_OR_ALL error condition into the existing
VALUE_NOT_ALLOWED condition. The classic and Spark Connect implementations of
DataFrame.dropna now report the allowed values through the generic condition, and the shared
test expectation is updated accordingly.

Why are the changes needed?

VALUE_NOT_ANY_OR_ALL is used only for DataFrame.dropna(how=...) and duplicates the existing
generic condition for arguments restricted to a fixed set of values. Removing it reduces the
number of narrowly scoped error conditions and aligns this validation with other PySpark APIs.

Does this PR introduce any user-facing change?

Yes. Invalid values for DataFrame.dropna(how=...) now use the VALUE_NOT_ALLOWED error
condition and its generic message. Valid calls and exception types are unchanged.

How was this patch tested?

The focused PySpark test was not run. The JSON error-condition file was parsed successfully,
git diff --check passed, and the existing shared error assertion was updated for both classic
and Spark Connect execution modes.

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

Generated-by: Codex (GPT-5)

@HyukjinKwon

Copy link
Copy Markdown
Member

Let's file a JIRA tho

@zhengruifeng zhengruifeng changed the title [PYTHON] Consolidate VALUE_NOT_ANY_OR_ALL into VALUE_NOT_ALLOWED [SPARK-58114][PYTHON] Consolidate VALUE_NOT_ANY_OR_ALL into VALUE_NOT_ALLOWED Jul 14, 2026
@zhengruifeng zhengruifeng marked this pull request as ready for review July 14, 2026 04:41

@dongjoon-hyun dongjoon-hyun 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.

+1, LGTM.

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

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

Consolidate the specialized PySpark `VALUE_NOT_ANY_OR_ALL` error condition into the existing
`VALUE_NOT_ALLOWED` condition. The classic and Spark Connect implementations of
`DataFrame.dropna` now report the allowed values through the generic condition, and the shared
test expectation is updated accordingly.

### Why are the changes needed?

`VALUE_NOT_ANY_OR_ALL` is used only for `DataFrame.dropna(how=...)` and duplicates the existing
generic condition for arguments restricted to a fixed set of values. Removing it reduces the
number of narrowly scoped error conditions and aligns this validation with other PySpark APIs.

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

Yes. Invalid values for `DataFrame.dropna(how=...)` now use the `VALUE_NOT_ALLOWED` error
condition and its generic message. Valid calls and exception types are unchanged.

### How was this patch tested?

The focused PySpark test was not run. The JSON error-condition file was parsed successfully,
`git diff --check` passed, and the existing shared error assertion was updated for both classic
and Spark Connect execution modes.

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

Generated-by: Codex (GPT-5)

Closes #57236 from zhengruifeng/consolidate-value-not-any-or-all-dev4.

Authored-by: Ruifeng Zheng <ruifengz@apache.org>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
(cherry picked from commit 76c0688)
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-value-not-any-or-all-dev4 branch July 15, 2026 00:59

@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.

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.

4 participants