chore(command): Organize Commands according to SIP-92 (#25850)

This commit is contained in:
John Bodley
2023-11-22 11:55:54 -08:00
committed by GitHub
parent 984c278c4c
commit 07bcfa9b5f
265 changed files with 786 additions and 808 deletions

View File

@@ -25,12 +25,12 @@ from flask import g
from flask_appbuilder.models.sqla.interface import SQLAInterface
from superset import is_feature_enabled, security_manager
from superset.daos.base import BaseDAO
from superset.dashboards.commands.exceptions import (
from superset.commands.dashboard.exceptions import (
DashboardAccessDeniedError,
DashboardForbiddenError,
DashboardNotFoundError,
)
from superset.daos.base import BaseDAO
from superset.dashboards.filter_sets.consts import (
DASHBOARD_ID_FIELD,
DESCRIPTION_FIELD,

View File

@@ -21,6 +21,8 @@ from typing import Any, Optional
from flask import g
from sqlalchemy.exc import SQLAlchemyError
from superset.commands.tag.exceptions import TagNotFoundError
from superset.commands.tag.utils import to_object_type
from superset.daos.base import BaseDAO
from superset.daos.exceptions import DAOCreateFailedError, DAODeleteFailedError
from superset.exceptions import MissingUserContextException
@@ -28,8 +30,6 @@ from superset.extensions import db
from superset.models.dashboard import Dashboard
from superset.models.slice import Slice
from superset.models.sql_lab import SavedQuery
from superset.tags.commands.exceptions import TagNotFoundError
from superset.tags.commands.utils import to_object_type
from superset.tags.models import (
get_tag,
ObjectType,
@@ -409,7 +409,9 @@ class TagDAO(BaseDAO[Tag]):
for object_type, object_id in tagged_objects_to_delete:
# delete objects that were removed
TagDAO.delete_tagged_object(
object_type, object_id, tag.name # type: ignore
object_type, # type: ignore
object_id,
tag.name,
)
db.session.add_all(tagged_objects)