code: def validate(self) -> None:
      self._database = db.session.query(Database).get(self._database_id)
      if not self._database:
          raise SupersetErrorException(
              SupersetError(
                  message=__("The database could not be found"),
                  error_type=SupersetErrorType.RESULTS_BACKEND_ERROR,
                  level=ErrorLevel.ERROR,
              ),
              status=404,
          )
  
file_path: superset/superset/commands/sql_lab/estimate.py
imports: from __future__ import annotations
  import logging
  from typing import Any
  from flask_babel import gettext
  from superset import app, db
  from superset.commands.base import BaseCommand
  from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
  from superset.exceptions import SupersetErrorException, SupersetTimeoutException
  from superset.jinja_context import get_template_processor
  from superset.models.core import Database
  from superset.sqllab.schemas import EstimateQueryCostSchema
  from superset.utils import core
label_desc: Use image node_id 2 for calling the QueryEstimationCommand obj's underlying member method code with example usage: obj.validate() without return types