This is an automated email from the ASF dual-hosted git repository. dongjoon pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new 467df65ceba [SPARK-46232][PYTHON][FOLLOWUP] Migrate `ValueError` into `PySparkValueError` 467df65ceba is described below commit 467df65ceba5f6a8957ca7d72f5537434bf32e81 Author: Haejoon Lee <haejoon....@databricks.com> AuthorDate: Wed Dec 6 10:51:22 2023 -0800 [SPARK-46232][PYTHON][FOLLOWUP] Migrate `ValueError` into `PySparkValueError` ### What changes were proposed in this pull request? This PR followups for https://github.com/apache/spark/pull/44149 to address missing case. ### Why are the changes needed? To improve error handling. ### Does this PR introduce _any_ user-facing change? No API changes. ### How was this patch tested? The existing CI should pass. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #44202 from itholic/SPARK-46232-followup. Authored-by: Haejoon Lee <haejoon....@databricks.com> Signed-off-by: Dongjoon Hyun <dh...@apple.com> --- python/pyspark/sql/pandas/serializers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/pyspark/sql/pandas/serializers.py b/python/pyspark/sql/pandas/serializers.py index 8b2b583ddaa..834f22c86c0 100644 --- a/python/pyspark/sql/pandas/serializers.py +++ b/python/pyspark/sql/pandas/serializers.py @@ -738,8 +738,9 @@ class CogroupPandasUDFSerializer(ArrowStreamPandasUDFSerializer): ) elif dataframes_in_group != 0: - raise ValueError( - "Invalid number of pandas.DataFrames in group {0}".format(dataframes_in_group) + raise PySparkValueError( + error_class="INVALID_NUMBER_OF_DATAFRAMES_IN_GROUP", + message_parameters={"dataframes_in_group": str(dataframes_in_group)}, ) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org