code: def extract_errors(
      cls, ex: Exception, context: dict[str, Any] | None = None
  ) -> list[SupersetError]:
      raw_message = cls._extract_error_message(ex)
  
      context = context or {}
      # access_token isn't currently parseable from the
      # databricks error response, but adding it in here
      # for reference if their error message changes
      context = {
          "host": context.get("hostname"),
          "access_token": context.get("password"),
          "port": context.get("port"),
          "username": context.get("username"),
          "database": context.get("database"),
      }
      for regex, (
          message,
          error_type,
          extra,
      ) in cls.custom_errors.items():
          match = regex.search(raw_message)
          if match:
              params = {**context, **match.groupdict()}
              extra["engine_name"] = cls.engine_name
              return [
                  SupersetError(
                      error_type=error_type,
                      message=message % params,
                      level=ErrorLevel.ERROR,
                      extra=extra,
                  )
              ]
  
      return [
          SupersetError(
              error_type=SupersetErrorType.GENERIC_DB_ENGINE_ERROR,
              message=cls._extract_error_message(ex),
              level=ErrorLevel.ERROR,
              extra={"engine_name": cls.engine_name},
          )
      ]
  
imports: from __future__ import annotations
  import json
  from datetime import datetime
  from typing import Any, TYPE_CHECKING, TypedDict
  from apispec import APISpec
  from apispec.ext.marshmallow import MarshmallowPlugin
  from flask_babel import gettext
  from marshmallow import fields, Schema
  from marshmallow.validate import Range
  from sqlalchemy.engine.reflection import Inspector
  from sqlalchemy.engine.url import URL
  from superset.constants import TimeGrain, USER_AGENT
  from superset.databases.utils import make_url_safe
  from superset.db_engine_specs.base import BaseEngineSpec, BasicParametersMixin
  from superset.db_engine_specs.hive import HiveEngineSpec
  from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
  from superset.utils.network import is_hostname_valid, is_port_open
label_desc: Use image node_id 4 for calling the DatabricksNativeEngineSpec obj's underlying member method code with example usage: obj.extract_errors(cls, ex, context) and returns: list, list