khalidmammadov opened a new pull request, #52837:
URL: https://github.com/apache/spark/pull/52837

   ### What changes were proposed in this pull request?
   Incorrect parameter **error** is used for CANNOT_PARSE_DATATYPE error class 
in PySpark code. It expects **msg**. Due to this the error produced during 
usage is incorrect:
   
   Example:
   ```
   StructField.fromJson({"name": "col1", "type": "NewType", "nullable": "True", 
"metadata": None}) 
   ```
   Error:
   ```
   assert set(message_parameters_from_template) == set(message_parameters), (
   AssertionError: Undefined error message parameter for error class: 
CANNOT_PARSE_DATATYPE. Parameters: {'error': 'NewType'} 
   ```
   
   
   
   ### Why are the changes needed?
   Bug fix
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes, now correct error would be printed into console:
   ```
   raise PySparkValueError(
   pyspark.errors.exceptions.base.PySparkValueError: [CANNOT_PARSE_DATATYPE] 
Unable to parse datatype. NewType.
   ```
   
   
   ### How was this patch tested?
   Added unit test and tested locally.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to