Commit 0d4d82d
[SPARK-56584][PYTHON] Generalize
### What changes were proposed in this pull request?
Two related cleanups in the PySpark result-verify path:
1. Rename error class `RESULT_TYPE_MISMATCH_FOR_ARROW_UDF` to the more general `RESULT_COLUMN_TYPES_MISMATCH` (parallel to `RESULT_COLUMN_NAMES_MISMATCH` / `RESULT_COLUMN_SCHEMA_MISMATCH`). The error is raised from the generic `verify_arrow_result` path in `python/pyspark/worker.py`; the name shouldn't mention "ARROW_UDF".
2. Reword the message to align with its siblings:
- Before: `Columns do not match in their data type: <mismatch>.`
- After: `Column types of the returned data do not match specified schema. Mismatch: <mismatch>.`
3. Remove the dead error class `SCHEMA_MISMATCH_FOR_ARROW_PYTHON_UDF`. `git grep` confirms no code path raises it, and its message body is identical to `SCHEMA_MISMATCH_FOR_PANDAS_UDF`.
### Why are the changes needed?
Part of [SPARK-55388](https://issues.apache.org/jira/browse/SPARK-55388) (Refactor PythonEvalType processing logic). Cleanup to make error class names and messages consistent across the result-verify path, and to remove dead code.
### Does this PR introduce _any_ user-facing change?
Yes. User-visible error class name and message for result column type mismatches in Arrow UDFs change. The unreleased `SCHEMA_MISMATCH_FOR_ARROW_PYTHON_UDF` class is removed (no code raised it).
### How was this patch tested?
Updated 4 existing asserts in `test_arrow_grouped_map.py` and `test_arrow_cogrouped_map.py` that match the new message.
### Was this patch authored or co-authored using generative AI tooling?
No
Closes #55494 from Yicong-Huang/SPARK-56584.
Authored-by: Yicong Huang <17627829+Yicong-Huang@users.noreply.github.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>RESULT_TYPE_MISMATCH_FOR_ARROW_UDF error class and remove dead SCHEMA_MISMATCH_FOR_ARROW_PYTHON_UDF
1 parent 845a1b5 commit 0d4d82d
4 files changed
Lines changed: 13 additions & 14 deletions
File tree
- python/pyspark
- errors
- sql/tests/arrow
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
811 | | - | |
| 811 | + | |
812 | 812 | | |
813 | | - | |
| 813 | + | |
814 | 814 | | |
815 | 815 | | |
816 | | - | |
| 816 | + | |
817 | 817 | | |
818 | | - | |
| 818 | + | |
819 | 819 | | |
820 | 820 | | |
821 | 821 | | |
822 | 822 | | |
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | 826 | | |
832 | 827 | | |
833 | 828 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| |||
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
174 | | - | |
| 175 | + | |
| 176 | + | |
175 | 177 | | |
176 | 178 | | |
177 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
| 175 | + | |
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| |||
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
199 | | - | |
| 200 | + | |
| 201 | + | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
615 | | - | |
| 615 | + | |
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
| |||
0 commit comments