You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Yicong Huang (Jira)" <ji...@apache.org> on 2026/08/03 20:36:00 UTC

[jira] [Resolved] (SPARK-58161) [PYTHON] Standardize PySpark UDF row count mismatch error to use RESULT_ROWS_MISMATCH

     [ https://issues.apache.org/jira/browse/SPARK-58161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yicong Huang resolved SPARK-58161.
----------------------------------
    Fix Version/s: 4.3.0
       Resolution: Fixed

Issue resolved by pull request 57292
[https://github.com/apache/spark/pull/57292]

> [PYTHON] Standardize PySpark UDF row count mismatch error to use RESULT_ROWS_MISMATCH
> -------------------------------------------------------------------------------------
>
>                 Key: SPARK-58161
>                 URL: https://issues.apache.org/jira/browse/SPARK-58161
>             Project: Spark
>          Issue Type: Improvement
>          Components: PySpark
>    Affects Versions: 4.3.0
>            Reporter: gaurav kumar pandey
>            Assignee: gaurav kumar pandey
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.3.0
>
>
> Currently, PySpark Pandas and Arrow UDFs raise a custom SCHEMA_MISMATCH_FOR_PANDAS_UDF error class when the returned result length does not match the input row count. 
> To align with Spark's error standardization efforts, we should migrate this to the standard RESULT_ROWS_MISMATCH error class and remove the redundant SCHEMA_MISMATCH_FOR_PANDAS_UDF from error-conditions.json.
> Proposed Changes:
> 1. Migrate UDF scalar and arrow verification logic in worker.py to raise RESULT_ROWS_MISMATCH with input/output length parameters.
> 2. Retain the old error message format ("Result vector from pandas_udf was not the required length...") in the message string for backward-compatibility with user code that asserts on the exception message.
> 3. Update affected unit tests, documentation guidelines (debugging.rst), and clean up error-conditions.json.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org