You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ur...@apache.org on 2026/08/21 07:15:17 UTC

(spark) branch branch-4.x updated: [SPARK-58921][CONNECT][PYTHON] Fix misspelled messageParameters argument in Spark Connect tag validation

This is an automated email from the ASF dual-hosted git repository.

uros-b pushed a commit to branch branch-4.x
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-4.x by this push:
     new 14c884c0ae04 [SPARK-58921][CONNECT][PYTHON] Fix misspelled messageParameters argument in Spark Connect tag validation
14c884c0ae04 is described below

commit 14c884c0ae04bace8fe9f1543cb34180f4c31d64
Author: Uros <22...@users.noreply.github.com>
AuthorDate: Fri Aug 21 07:14:57 2026 +0000

    [SPARK-58921][CONNECT][PYTHON] Fix misspelled messageParameters argument in Spark Connect tag validation
    
    ### What changes were proposed in this pull request?
    
    Fixes a misspelled keyword argument in a `PySparkValueError` raised by the Spark Connect Python client. In `python/pyspark/sql/connect/client/core.py`, the error for a `None` tag was constructed with `message_paramters=` instead of `messageParameters=`.
    
    ### Why are the changes needed?
    
    `PySparkValueError.__init__` (`pyspark/errors/exceptions/base.py`) accepts `messageParameters` and does not accept `**kwargs`. As a result, when the tag validation hits the `None` case it raises `TypeError: __init__() got an unexpected keyword argument 'message_paramters'` instead of the intended `CANNOT_BE_NONE` error. This is a latent bug on the error path.
    
    ### Does this PR introduce _any_ user-facing change?
    
    Yes. Passing `None` where a Spark Connect tag is required now raises the intended `PySparkValueError` (`CANNOT_BE_NONE`) with its message, instead of a confusing `TypeError`.
    
    ### How was this patch tested?
    
    The keyword is corrected to match the `PySparkValueError` constructor parameter. The affected path was previously unexercised, which is why the typo went unnoticed; I can add a regression test asserting `PySparkValueError` is raised for a `None` tag if preferred.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Code (Opus 4.8)
    
    Closes #58180 from uros-b/typo-pyspark-message-params.
    
    Authored-by: Uros <22...@users.noreply.github.com>
    Signed-off-by: Uros Bojanic <22...@users.noreply.github.com>
    (cherry picked from commit 29f50bd5107f0910db9831293cc826c2d1c7d93e)
    Signed-off-by: Uros Bojanic <22...@users.noreply.github.com>
---
 python/pyspark/sql/connect/client/core.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/pyspark/sql/connect/client/core.py b/python/pyspark/sql/connect/client/core.py
index 03bd25e9c34e..1712a9fb41b8 100644
--- a/python/pyspark/sql/connect/client/core.py
+++ b/python/pyspark/sql/connect/client/core.py
@@ -2286,7 +2286,7 @@ class SparkConnectClient(object):
         spark_job_tags_sep = ","
         if tag is None:
             raise PySparkValueError(
-                errorClass="CANNOT_BE_NONE", message_paramters={"arg_name": "Spark Connect tag"}
+                errorClass="CANNOT_BE_NONE", messageParameters={"arg_name": "Spark Connect tag"}
             )
         if spark_job_tags_sep in tag:
             raise PySparkValueError(


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