Antonio-RiveroMartnez commented on code in PR #22024: URL: https://github.com/apache/superset/pull/22024#discussion_r1017299068
########## superset/db_engine_specs/bigquery.py: ########## @@ -578,3 +578,17 @@ def _get_fields(cls, cols: List[Dict[str, Any]]) -> List[Any]: "author__name" and "author__email", respectively. """ return [column(c["name"]).label(c["name"].replace(".", "__")) for c in cols] + + @classmethod + def parse_error_exception(cls, exception: Exception) -> Exception: + try: + return Exception( + str(exception) # pylint: disable=use-maxsplit-arg + .rsplit("\n")[0] + .rsplit(":")[1] + .strip() + ) + except Exception: # pylint: disable=broad-except Review Comment: Hmm if for some unknown reason the Exception has no `:` for example, accessing the [1] would cause a: `IndexError: list index out of range`. Just adding the try/catch there in case anything like that happens with the message we get. -- 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: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org