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

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


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

commit 7367a2765ccaf8e1febea0de3830a8299713a963
Author: Uros <[email protected]>
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 <[email protected]>
    Signed-off-by: Uros Bojanic <[email protected]>
    (cherry picked from commit 29f50bd5107f0910db9831293cc826c2d1c7d93e)
    Signed-off-by: Uros Bojanic <[email protected]>
---
 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 0ff6f0ae90f9..be974ffcbde2 100644
--- a/python/pyspark/sql/connect/client/core.py
+++ b/python/pyspark/sql/connect/client/core.py
@@ -2257,7 +2257,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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to