allisonwang-db commented on code in PR #40926:
URL: https://github.com/apache/spark/pull/40926#discussion_r1177769747
##########
python/pyspark/errors/error_classes.py:
##########
@@ -64,6 +69,11 @@
"Argument `<arg_name>` can not be None."
]
},
+ "CANNOT_CONVERT": {
Review Comment:
Maybe `CANNOT_CONVERT_TYPE`
##########
python/pyspark/errors/error_classes.py:
##########
@@ -74,6 +84,21 @@
"Can not infer Array Type from an list with None as the first element."
]
},
+ "CANNOT_INFER_SCHEMA_FOR_TYPE": {
+ "message": [
+ "Can not infer schema for type: `<data_type>`."
Review Comment:
Do we need to wrap any data_type reference in ``?
##########
python/pyspark/sql/types.py:
##########
@@ -2183,7 +2216,13 @@ def asDict(self, recursive: bool = False) -> Dict[str,
Any]:
True
"""
if not hasattr(self, "__fields__"):
- raise TypeError("Cannot convert a Row class into dict")
+ raise PySparkTypeError(
+ error_class="CANNOT_CONVERT",
+ message_parameters={
+ "from_type": "Row",
Review Comment:
Here should be `a Row class`?
--
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]