allisonwang-db commented on code in PR #40672:
URL: https://github.com/apache/spark/pull/40672#discussion_r1159953337
##########
python/pyspark/errors/exceptions/base.py:
##########
@@ -31,14 +31,12 @@ def __init__(
error_class: Optional[str] = None,
message_parameters: Optional[Dict[str, str]] = None,
):
- # `message` vs `error_class` & `message_parameters` are mutually
exclusive.
- assert (message is not None and (error_class is None and
message_parameters is None)) or (
- message is None and (error_class is not None and
message_parameters is not None)
- )
-
- self.error_reader = ErrorClassesReader()
-
if message is None:
+ assert (
Review Comment:
Why can't these errors include all of the following: error messages, error
classes, parameters, and SQL states? If the error message field is None, we can
render the message from the error class and parameter. This approach allows us
to check for error classes in PySpark unit tests as well.
--
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]