DamianPendrak commented on code in PR #34674:
URL: https://github.com/apache/superset/pull/34674#discussion_r2343541996


##########
superset/db_engine_specs/databricks.py:
##########
@@ -279,19 +280,40 @@ def get_table_names(
 
     @classmethod
     def extract_errors(
-        cls, ex: Exception, context: dict[str, Any] | None = None
+        cls,
+        ex: Exception,
+        context: dict[str, Any] | None = None,
+        database_name: str | None = None,
     ) -> list[SupersetError]:
         raw_message = cls._extract_error_message(ex)
 
         context = context or {}
+
+        config_custom_errors = app.config.get("CUSTOM_DATABASE_ERRORS", {})
         # access_token isn't currently parseable from the
         # databricks error response, but adding it in here
         # for reference if their error message changes
 
         for key, value in cls.context_key_mapping.items():
             context[key] = context.get(value)
 
-        for regex, (message, error_type, extra) in cls.custom_errors.items():
+        if not isinstance(config_custom_errors, dict):
+            config_custom_errors = {}
+
+        db_engine_custom_errors = {}

Review Comment:
   Good point. Moved it to a method



-- 
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]

Reply via email to