From eb9d92414af9035902f0e47a61715ba2940c9794 Mon Sep 17 00:00:00 2001 From: Yicong-Huang <17627829+Yicong-Huang@users.noreply.github.com> Date: Wed, 5 Aug 2026 00:20:16 +0000 Subject: [PATCH] test: accept both RESULT_ROWS_MISMATCH and SCHEMA_MISMATCH_FOR_PANDAS_UDF messages --- python/pyspark/sql/tests/pandas/test_pandas_udf_scalar.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/pyspark/sql/tests/pandas/test_pandas_udf_scalar.py b/python/pyspark/sql/tests/pandas/test_pandas_udf_scalar.py index 72d9fa566deef..28f6b506eedd6 100644 --- a/python/pyspark/sql/tests/pandas/test_pandas_udf_scalar.py +++ b/python/pyspark/sql/tests/pandas/test_pandas_udf_scalar.py @@ -677,8 +677,13 @@ def test_vectorized_udf_invalid_length(self): def check_vectorized_udf_invalid_length(self): df = self.spark.range(10) raise_exception = pandas_udf(lambda _: pd.Series(1), LongType()) + # Accept both this branch's SCHEMA_MISMATCH_FOR_PANDAS_UDF message and the + # RESULT_ROWS_MISMATCH message a newer server raises (SPARK-58529), so the + # cross-version old-client job passes against a master server. with self.assertRaisesRegex( - Exception, "Result vector from pandas_udf was not the required length" + Exception, + "Result vector from pandas_udf was not the required length" + "|The number of output rows.*must match the number of input rows", ): df.select(raise_exception(col("id"))).collect()