mistercrunch commented on code in PR #20395:
URL: https://github.com/apache/superset/pull/20395#discussion_r900314855
##########
superset/db_engine_specs/base.py:
##########
@@ -901,6 +901,15 @@ def _extract_error_message(cls, ex: Exception) -> str:
"""Extract error message for queries"""
return utils.error_msg_from_exception(ex)
+ @classmethod
+ def _reformat_error_message(cls, message: str) -> Tuple[str, str]:
+ """Reformat error message for user experience"""
+ splitted_message = re.split("\n+", message, 1)
+ if len(splitted_message) > 1:
+ return splitted_message[0], splitted_message[1]
+
+ return splitted_message[0], ""
Review Comment:
I would implement a no-op in `base.py`, something that does very little and
maintains the current behavior as the default behavior. `big_query.py` would do
the line parsing/splitting based on exactly how things are formatted there.
--
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]