Skip to content

Commit fc1c88d

Browse files
yaooqinnasl3
authored andcommitted
[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 apache#51414 from yaooqinn/SPARK-52721. Authored-by: Kent Yao <yao@apache.org> Signed-off-by: Kent Yao <yao@apache.org>
1 parent d0acf3b commit fc1c88d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

python/pyspark/sql/classic/dataframe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def schema(self) -> StructType:
207207
except Exception as e:
208208
raise PySparkValueError(
209209
errorClass="CANNOT_PARSE_DATATYPE",
210-
messageParameters={"error": str(e)},
210+
messageParameters={"msg": str(e)},
211211
)
212212

213213
def printSchema(self, level: Optional[int] = None) -> None:

python/pyspark/sql/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2012,7 +2012,7 @@ def _parse_datatype_json_value(
20122012
else:
20132013
raise PySparkValueError(
20142014
errorClass="CANNOT_PARSE_DATATYPE",
2015-
messageParameters={"error": str(json_value)},
2015+
messageParameters={"msg": str(json_value)},
20162016
)
20172017
else:
20182018
tpe = json_value["type"]

0 commit comments

Comments
 (0)