code: def validate(self) -> None:
      exceptions: list[ValidationError] = []
      database_id = self._properties["database"]
      table_name = self._properties["table_name"]
      schema = self._properties.get("schema", None)
      sql = self._properties.get("sql", None)
      owner_ids: Optional[list[int]] = self._properties.get("owners")
  
      # Validate uniqueness
      if not DatasetDAO.validate_uniqueness(
          database_id, schema, table_name
      ):
          exceptions.append(DatasetExistsValidationError(table_name))
  
      # Validate/Populate database
      database = DatasetDAO.get_database_by_id(database_id)
      if not database:
          exceptions.append(DatabaseNotFoundValidationError())
      self._properties["database"] = database
  
      # Validate table exists on dataset if sql is not provided
      # This should be validated when the dataset is physical
      if (
          database
          and not sql
          and not DatasetDAO.validate_table_exists(
              database, table_name, schema
          )
      ):
          exceptions.append(TableNotFoundValidationError(table_name))
  
      if sql:
          try:
              security_manager.raise_for_access(
                  database=database,
                  sql=sql,
                  schema=schema,
              )
          except SupersetSecurityException as ex:
              exceptions.append(
                  DatasetDataAccessIsNotAllowed(ex.error.message)
              )
      try:
          owners = self.populate_owners(owner_ids)
          self._properties["owners"] = owners
      except ValidationError as ex:
          exceptions.append(ex)
      if exceptions:
          raise DatasetInvalidError(exceptions=exceptions)
  
file_path: superset/superset/commands/dataset/create.py
imports: import logging
  from typing import Any, Optional
  from flask_appbuilder.models.sqla import Model
  from marshmallow import ValidationError
  from sqlalchemy.exc import SQLAlchemyError
  from superset.commands.base import BaseCommand, CreateMixin
  from superset.commands.dataset.exceptions import DatabaseNotFoundValidationError, DatasetCreateFailedError, DatasetDataAccessIsNotAllowed, DatasetExistsValidationError, DatasetInvalidError, TableNotFoundValidationError
  from superset.daos.dataset import DatasetDAO
  from superset.daos.exceptions import DAOCreateFailedError
  from superset.exceptions import SupersetSecurityException
  from superset.extensions import db, security_manager
label_desc: Use image node_id 3 for calling the CreateDatasetCommand obj's underlying member method code with example usage: obj.validate() without return types