You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ya...@apache.org on 2025/07/09 09:40:10 UTC
(spark) branch branch-4.0 updated: [SPARK-52721][PYTHON] Fix message parameter for CANNOT_PARSE_DATATYPE
This is an automated email from the ASF dual-hosted git repository.
yao pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new 78f2d526df29 [SPARK-52721][PYTHON] Fix message parameter for CANNOT_PARSE_DATATYPE
78f2d526df29 is described below
commit 78f2d526df29b6d3d96341de98b88521e599a682
Author: Kent Yao <ya...@apache.org>
AuthorDate: Wed Jul 9 17:39:42 2025 +0800
[SPARK-52721][PYTHON] Fix message parameter for CANNOT_PARSE_DATATYPE
### What changes were proposed in this pull request?
Fix message parameter for CANNOT_PARSE_DATATYPE
### Why are the changes needed?
bugfix
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
- Before
AssertionError: Undefined error message parameter for error class: CANNOT_PARSE_DATATYPE. Parameters: {'error':
- After
pyspark.errors.exceptions.base.PySparkValueError: [CANNOT_PARSE_DATATYPE] Unable to parse datatype.
### Was this patch authored or co-authored using generative AI tooling?
no
Closes #51414 from yaooqinn/SPARK-52721.
Authored-by: Kent Yao <ya...@apache.org>
Signed-off-by: Kent Yao <ya...@apache.org>
(cherry picked from commit c6e864538e2d8e3c816ba0f0a7bb9e212adc0a9d)
Signed-off-by: Kent Yao <ya...@apache.org>
---
python/pyspark/sql/classic/dataframe.py | 2 +-
python/pyspark/sql/types.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/python/pyspark/sql/classic/dataframe.py b/python/pyspark/sql/classic/dataframe.py
index f72c066a6572..722f0615b370 100644
--- a/python/pyspark/sql/classic/dataframe.py
+++ b/python/pyspark/sql/classic/dataframe.py
@@ -207,7 +207,7 @@ class DataFrame(ParentDataFrame, PandasMapOpsMixin, PandasConversionMixin):
except Exception as e:
raise PySparkValueError(
errorClass="CANNOT_PARSE_DATATYPE",
- messageParameters={"error": str(e)},
+ messageParameters={"msg": str(e)},
)
def printSchema(self, level: Optional[int] = None) -> None:
diff --git a/python/pyspark/sql/types.py b/python/pyspark/sql/types.py
index b46a08c597a7..451a80e2a53a 100644
--- a/python/pyspark/sql/types.py
+++ b/python/pyspark/sql/types.py
@@ -2012,7 +2012,7 @@ def _parse_datatype_json_value(
else:
raise PySparkValueError(
errorClass="CANNOT_PARSE_DATATYPE",
- messageParameters={"error": str(json_value)},
+ messageParameters={"msg": str(json_value)},
)
else:
tpe = json_value["type"]
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org