You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/11/03 16:46:47 UTC

[GitHub] [superset] hughhhh commented on a diff in pull request #22024: chore(bigquery): Add extra logging for BigQuery exceptions so we can have better insight on exceptions

hughhhh commented on code in PR #22024:
URL: https://github.com/apache/superset/pull/22024#discussion_r1013158699


##########
superset/db_engine_specs/bigquery.py:
##########
@@ -578,3 +578,7 @@ 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_message: str) -> str:
+        return exception_message.rsplit("\n")[0]

Review Comment:
   Can we have better try/exception catching here just incase we can't find the new line? Then a write test to back this whenever `parse_error_exception` raises.



##########
superset/db_engine_specs/base.py:
##########
@@ -443,6 +452,9 @@ def get_dbapi_mapped_exception(cls, exception: Exception) -> Exception:
         """
         new_exception = cls.get_dbapi_exception_mapping().get(type(exception))
         if not new_exception:
+            # We are interested in just BigQuery exceptions
+            if cls.engine == "bigquery":

Review Comment:
   can we add `bigquery` to this engine + add it here as `Engines.BigQuery`
   
   https://github.com/apache/superset/blob/66c0801e494f16ba44d492f3648c1e1a57c8e35a/superset-frontend/src/views/CRUD/data/database/types.ts#L150



-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org