itholic commented on code in PR #44292:
URL: https://github.com/apache/spark/pull/44292#discussion_r1423294143
##########
python/pyspark/errors/exceptions/base.py:
##########
@@ -89,13 +91,28 @@ def getSqlState(self) -> Optional[str]:
See Also
--------
:meth:`PySparkException.getErrorClass`
+ :meth:`PySparkException.getMessage`
:meth:`PySparkException.getMessageParameters`
"""
return None
+ def getMessage(self) -> str:
+ """
+ Returns full error message.
+
+ .. versionadded:: 4.0.0
+
+ See Also
+ --------
+ :meth:`PySparkException.getErrorClass`
+ :meth:`PySparkException.getMessageParameters`
+ :meth:`PySparkException.getSqlState`
+ """
+ return f"[{self.getErrorClass()}] {self._message}"
+
def __str__(self) -> str:
if self.getErrorClass() is not None:
- return f"[{self.getErrorClass()}] {self._message}"
Review Comment:
Yeah, actually we don't touch the behavior of `__str__` but just arrange the
code places here so I believe it would be fine.
--
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]