[SPARK-55579][PYTHON] Rename PySpark error classes to be eval-type-agnostic#54996
Open
Yicong-Huang wants to merge 1 commit intoapache:masterfrom
Open
[SPARK-55579][PYTHON] Rename PySpark error classes to be eval-type-agnostic#54996Yicong-Huang wants to merge 1 commit intoapache:masterfrom
Yicong-Huang wants to merge 1 commit intoapache:masterfrom
Conversation
46a6596 to
a4919d0
Compare
| PythonException, | ||
| "PySparkRuntimeError: \\[RESULT_COLUMNS_MISMATCH_FOR_PANDAS_UDF\\] " | ||
| "Column names of the returned pandas.DataFrame do not match " | ||
| "PySparkRuntimeError: \\[RESULT_COLUMNS_MISMATCH_NAMES\\] " |
Contributor
There was a problem hiding this comment.
what about RESULT_COLUMN_NAMES_MISMATCH
Contributor
Author
There was a problem hiding this comment.
thanks. changed to this one
| ] | ||
| }, | ||
| "RESULT_LENGTH_MISMATCH_FOR_PANDAS_UDF": { | ||
| "RESULT_COLUMNS_MISMATCH_SCHEMA": { |
Contributor
There was a problem hiding this comment.
what about RESULT_COLUMN_SCHEMA_MISMATCH
Contributor
Author
There was a problem hiding this comment.
thanks. changed to this one
Contributor
zhengruifeng
left a comment
There was a problem hiding this comment.
minor comments, otherwise LGTM
a4919d0 to
1fb783b
Compare
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?
Rename six PySpark error conditions to be generic and not tied to specific UDF eval types:
PANDAS_UDF_OUTPUT_EXCEEDS_INPUT_ROWSOUTPUT_EXCEEDS_INPUT_ROWSRESULT_LENGTH_MISMATCH_FOR_SCALAR_ITER_PANDAS_UDFRESULT_ROWS_MISMATCHSTOP_ITERATION_OCCURRED_FROM_SCALAR_ITER_PANDAS_UDFINPUT_NOT_FULLY_CONSUMEDRESULT_LENGTH_MISMATCH_FOR_PANDAS_UDFRESULT_COLUMN_SCHEMA_MISMATCHRESULT_COLUMNS_MISMATCH_FOR_PANDAS_UDFRESULT_COLUMN_NAMES_MISMATCHRESULT_COLUMNS_MISMATCH_FOR_ARROW_UDFRESULT_COLUMN_NAMES_MISMATCH(merged)Also updated error messages to not reference specific eval types or data structures (e.g., "pandas.DataFrame", "pyarrow.Table" -> "data").
Why are the changes needed?
These error conditions were originally created for Pandas UDFs, but are now shared by Arrow UDFs as well. The names and messages should be generic so they can be reused across different eval types without confusion.
Part of SPARK-55388.
Does this PR introduce any user-facing change?
Yes. Error condition names and messages are updated. Users who catch specific error conditions by name will need to update their references.
How was this patch tested?
Existing tests updated to match new error condition names and messages.
Was this patch authored or co-authored using generative AI tooling?
No