From afa72000745fc696b058eb827b8f7963149dd144 Mon Sep 17 00:00:00 2001 From: Antonio Rivero Date: Tue, 8 Nov 2022 22:27:28 -0300 Subject: [PATCH] BigQuery: - Use splitlines instead and avoid ignoring pylint rules --- superset/db_engine_specs/bigquery.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/superset/db_engine_specs/bigquery.py b/superset/db_engine_specs/bigquery.py index 3a93f0031bb1d..373fc2f747375 100644 --- a/superset/db_engine_specs/bigquery.py +++ b/superset/db_engine_specs/bigquery.py @@ -582,12 +582,7 @@ def _get_fields(cls, cols: List[Dict[str, Any]]) -> List[Any]: @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() - ) + return Exception(str(exception).splitlines()[0].rsplit(":")[1].strip()) except Exception: # pylint: disable=broad-except # If for some reason we get an exception, for example, no new line # We will return the original exception