code: def pre_delete(self, database: Database) -> None:
      if database.tables:
          raise SupersetException(
              Markup(
                  "Cannot delete a database that has tables attached. "
                  "Here's the list of associated tables: "
                  + ", ".join(f"{table}" for table in database.tables)
              )
          )
  
file_path: superset/superset/views/database/mixins.py
imports: import inspect
  from flask import Markup
  from flask_babel import lazy_gettext
  from sqlalchemy import MetaData
  from superset import app, security_manager
  from superset.databases.filters import DatabaseFilter
  from superset.databases.utils import make_url_safe
  from superset.exceptions import SupersetException
  from superset.models.core import Database
  from superset.security.analytics_db_safety import check_sqlalchemy_uri
  from superset.utils import core
label_desc: Use image node_id 4 for calling the DatabaseMixin obj's underlying member method code with example usage: obj.pre_delete(database) without return types