chore(command): Organize Commands according to SIP-92 (#25850)
This commit is contained in:
parent
984c278c4c
commit
07bcfa9b5f
|
|
@ -24,22 +24,6 @@ from flask_appbuilder.models.sqla.interface import SQLAInterface
|
|||
from flask_babel import ngettext
|
||||
from marshmallow import ValidationError
|
||||
|
||||
from superset.annotation_layers.annotations.commands.create import (
|
||||
CreateAnnotationCommand,
|
||||
)
|
||||
from superset.annotation_layers.annotations.commands.delete import (
|
||||
DeleteAnnotationCommand,
|
||||
)
|
||||
from superset.annotation_layers.annotations.commands.exceptions import (
|
||||
AnnotationCreateFailedError,
|
||||
AnnotationDeleteFailedError,
|
||||
AnnotationInvalidError,
|
||||
AnnotationNotFoundError,
|
||||
AnnotationUpdateFailedError,
|
||||
)
|
||||
from superset.annotation_layers.annotations.commands.update import (
|
||||
UpdateAnnotationCommand,
|
||||
)
|
||||
from superset.annotation_layers.annotations.filters import AnnotationAllTextFilter
|
||||
from superset.annotation_layers.annotations.schemas import (
|
||||
AnnotationPostSchema,
|
||||
|
|
@ -47,7 +31,17 @@ from superset.annotation_layers.annotations.schemas import (
|
|||
get_delete_ids_schema,
|
||||
openapi_spec_methods_override,
|
||||
)
|
||||
from superset.annotation_layers.commands.exceptions import AnnotationLayerNotFoundError
|
||||
from superset.commands.annotation_layer.annotation.create import CreateAnnotationCommand
|
||||
from superset.commands.annotation_layer.annotation.delete import DeleteAnnotationCommand
|
||||
from superset.commands.annotation_layer.annotation.exceptions import (
|
||||
AnnotationCreateFailedError,
|
||||
AnnotationDeleteFailedError,
|
||||
AnnotationInvalidError,
|
||||
AnnotationNotFoundError,
|
||||
AnnotationUpdateFailedError,
|
||||
)
|
||||
from superset.commands.annotation_layer.annotation.update import UpdateAnnotationCommand
|
||||
from superset.commands.annotation_layer.exceptions import AnnotationLayerNotFoundError
|
||||
from superset.constants import MODEL_API_RW_METHOD_PERMISSION_MAP, RouteMethod
|
||||
from superset.models.annotations import Annotation
|
||||
from superset.views.base_api import (
|
||||
|
|
|
|||
|
|
@ -23,17 +23,6 @@ from flask_appbuilder.models.sqla.interface import SQLAInterface
|
|||
from flask_babel import ngettext
|
||||
from marshmallow import ValidationError
|
||||
|
||||
from superset.annotation_layers.commands.create import CreateAnnotationLayerCommand
|
||||
from superset.annotation_layers.commands.delete import DeleteAnnotationLayerCommand
|
||||
from superset.annotation_layers.commands.exceptions import (
|
||||
AnnotationLayerCreateFailedError,
|
||||
AnnotationLayerDeleteFailedError,
|
||||
AnnotationLayerDeleteIntegrityError,
|
||||
AnnotationLayerInvalidError,
|
||||
AnnotationLayerNotFoundError,
|
||||
AnnotationLayerUpdateFailedError,
|
||||
)
|
||||
from superset.annotation_layers.commands.update import UpdateAnnotationLayerCommand
|
||||
from superset.annotation_layers.filters import AnnotationLayerAllTextFilter
|
||||
from superset.annotation_layers.schemas import (
|
||||
AnnotationLayerPostSchema,
|
||||
|
|
@ -41,6 +30,17 @@ from superset.annotation_layers.schemas import (
|
|||
get_delete_ids_schema,
|
||||
openapi_spec_methods_override,
|
||||
)
|
||||
from superset.commands.annotation_layer.create import CreateAnnotationLayerCommand
|
||||
from superset.commands.annotation_layer.delete import DeleteAnnotationLayerCommand
|
||||
from superset.commands.annotation_layer.exceptions import (
|
||||
AnnotationLayerCreateFailedError,
|
||||
AnnotationLayerDeleteFailedError,
|
||||
AnnotationLayerDeleteIntegrityError,
|
||||
AnnotationLayerInvalidError,
|
||||
AnnotationLayerNotFoundError,
|
||||
AnnotationLayerUpdateFailedError,
|
||||
)
|
||||
from superset.commands.annotation_layer.update import UpdateAnnotationLayerCommand
|
||||
from superset.constants import MODEL_API_RW_METHOD_PERMISSION_MAP, RouteMethod
|
||||
from superset.extensions import event_logger
|
||||
from superset.models.annotations import AnnotationLayer
|
||||
|
|
|
|||
|
|
@ -32,21 +32,6 @@ from werkzeug.wrappers import Response as WerkzeugResponse
|
|||
from werkzeug.wsgi import FileWrapper
|
||||
|
||||
from superset import app, is_feature_enabled, thumbnail_cache
|
||||
from superset.charts.commands.create import CreateChartCommand
|
||||
from superset.charts.commands.delete import DeleteChartCommand
|
||||
from superset.charts.commands.exceptions import (
|
||||
ChartCreateFailedError,
|
||||
ChartDeleteFailedError,
|
||||
ChartForbiddenError,
|
||||
ChartInvalidError,
|
||||
ChartNotFoundError,
|
||||
ChartUpdateFailedError,
|
||||
DashboardsForbiddenError,
|
||||
)
|
||||
from superset.charts.commands.export import ExportChartsCommand
|
||||
from superset.charts.commands.importers.dispatcher import ImportChartsCommand
|
||||
from superset.charts.commands.update import UpdateChartCommand
|
||||
from superset.charts.commands.warm_up_cache import ChartWarmUpCacheCommand
|
||||
from superset.charts.filters import (
|
||||
ChartAllTextFilter,
|
||||
ChartCertifiedFilter,
|
||||
|
|
@ -69,6 +54,21 @@ from superset.charts.schemas import (
|
|||
screenshot_query_schema,
|
||||
thumbnail_query_schema,
|
||||
)
|
||||
from superset.commands.chart.create import CreateChartCommand
|
||||
from superset.commands.chart.delete import DeleteChartCommand
|
||||
from superset.commands.chart.exceptions import (
|
||||
ChartCreateFailedError,
|
||||
ChartDeleteFailedError,
|
||||
ChartForbiddenError,
|
||||
ChartInvalidError,
|
||||
ChartNotFoundError,
|
||||
ChartUpdateFailedError,
|
||||
DashboardsForbiddenError,
|
||||
)
|
||||
from superset.commands.chart.export import ExportChartsCommand
|
||||
from superset.commands.chart.importers.dispatcher import ImportChartsCommand
|
||||
from superset.commands.chart.update import UpdateChartCommand
|
||||
from superset.commands.chart.warm_up_cache import ChartWarmUpCacheCommand
|
||||
from superset.commands.exceptions import CommandException
|
||||
from superset.commands.importers.exceptions import (
|
||||
IncorrectFormatError,
|
||||
|
|
|
|||
|
|
@ -30,17 +30,17 @@ from marshmallow import ValidationError
|
|||
from superset import is_feature_enabled, security_manager
|
||||
from superset.async_events.async_query_manager import AsyncQueryTokenException
|
||||
from superset.charts.api import ChartRestApi
|
||||
from superset.charts.commands.exceptions import (
|
||||
ChartDataCacheLoadError,
|
||||
ChartDataQueryFailedError,
|
||||
)
|
||||
from superset.charts.data.commands.create_async_job_command import (
|
||||
CreateAsyncChartDataJobCommand,
|
||||
)
|
||||
from superset.charts.data.commands.get_data_command import ChartDataCommand
|
||||
from superset.charts.data.query_context_cache_loader import QueryContextCacheLoader
|
||||
from superset.charts.post_processing import apply_post_process
|
||||
from superset.charts.schemas import ChartDataQueryContextSchema
|
||||
from superset.commands.chart.data.create_async_job_command import (
|
||||
CreateAsyncChartDataJobCommand,
|
||||
)
|
||||
from superset.commands.chart.data.get_data_command import ChartDataCommand
|
||||
from superset.commands.chart.exceptions import (
|
||||
ChartDataCacheLoadError,
|
||||
ChartDataQueryFailedError,
|
||||
)
|
||||
from superset.common.chart_data import ChartDataResultFormat, ChartDataResultType
|
||||
from superset.connectors.sqla.models import BaseDatasource
|
||||
from superset.daos.exceptions import DatasourceNotFound
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
from typing import Any
|
||||
|
||||
from superset import cache
|
||||
from superset.charts.commands.exceptions import ChartDataCacheLoadError
|
||||
from superset.commands.chart.exceptions import ChartDataCacheLoadError
|
||||
|
||||
|
||||
class QueryContextCacheLoader: # pylint: disable=too-few-public-methods
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ if feature_flags.get("VERSIONED_EXPORT"):
|
|||
def export_dashboards(dashboard_file: Optional[str] = None) -> None:
|
||||
"""Export dashboards to ZIP file"""
|
||||
# pylint: disable=import-outside-toplevel
|
||||
from superset.dashboards.commands.export import ExportDashboardsCommand
|
||||
from superset.commands.dashboard.export import ExportDashboardsCommand
|
||||
from superset.models.dashboard import Dashboard
|
||||
|
||||
g.user = security_manager.find_user(username="admin")
|
||||
|
|
@ -106,8 +106,8 @@ if feature_flags.get("VERSIONED_EXPORT"):
|
|||
def export_datasources(datasource_file: Optional[str] = None) -> None:
|
||||
"""Export datasources to ZIP file"""
|
||||
# pylint: disable=import-outside-toplevel
|
||||
from superset.commands.dataset.export import ExportDatasetsCommand
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.datasets.commands.export import ExportDatasetsCommand
|
||||
|
||||
g.user = security_manager.find_user(username="admin")
|
||||
|
||||
|
|
@ -144,10 +144,10 @@ if feature_flags.get("VERSIONED_EXPORT"):
|
|||
def import_dashboards(path: str, username: Optional[str]) -> None:
|
||||
"""Import dashboards from ZIP file"""
|
||||
# pylint: disable=import-outside-toplevel
|
||||
from superset.commands.importers.v1.utils import get_contents_from_bundle
|
||||
from superset.dashboards.commands.importers.dispatcher import (
|
||||
from superset.commands.dashboard.importers.dispatcher import (
|
||||
ImportDashboardsCommand,
|
||||
)
|
||||
from superset.commands.importers.v1.utils import get_contents_from_bundle
|
||||
|
||||
if username is not None:
|
||||
g.user = security_manager.find_user(username=username)
|
||||
|
|
@ -176,10 +176,8 @@ if feature_flags.get("VERSIONED_EXPORT"):
|
|||
def import_datasources(path: str) -> None:
|
||||
"""Import datasources from ZIP file"""
|
||||
# pylint: disable=import-outside-toplevel
|
||||
from superset.commands.dataset.importers.dispatcher import ImportDatasetsCommand
|
||||
from superset.commands.importers.v1.utils import get_contents_from_bundle
|
||||
from superset.datasets.commands.importers.dispatcher import (
|
||||
ImportDatasetsCommand,
|
||||
)
|
||||
|
||||
if is_zipfile(path):
|
||||
with ZipFile(path) as bundle:
|
||||
|
|
@ -304,7 +302,7 @@ else:
|
|||
def import_dashboards(path: str, recursive: bool, username: str) -> None:
|
||||
"""Import dashboards from JSON file"""
|
||||
# pylint: disable=import-outside-toplevel
|
||||
from superset.dashboards.commands.importers.v0 import ImportDashboardsCommand
|
||||
from superset.commands.dashboard.importers.v0 import ImportDashboardsCommand
|
||||
|
||||
path_object = Path(path)
|
||||
files: list[Path] = []
|
||||
|
|
@ -353,7 +351,7 @@ else:
|
|||
def import_datasources(path: str, sync: str, recursive: bool) -> None:
|
||||
"""Import datasources from YAML"""
|
||||
# pylint: disable=import-outside-toplevel
|
||||
from superset.datasets.commands.importers.v0 import ImportDatasetsCommand
|
||||
from superset.commands.dataset.importers.v0 import ImportDatasetsCommand
|
||||
|
||||
sync_array = sync.split(",")
|
||||
sync_columns = "columns" in sync_array
|
||||
|
|
|
|||
|
|
@ -21,15 +21,15 @@ from typing import Any, Optional
|
|||
from flask_appbuilder.models.sqla import Model
|
||||
from marshmallow import ValidationError
|
||||
|
||||
from superset.annotation_layers.annotations.commands.exceptions import (
|
||||
from superset.commands.annotation_layer.annotation.exceptions import (
|
||||
AnnotationCreateFailedError,
|
||||
AnnotationDatesValidationError,
|
||||
AnnotationInvalidError,
|
||||
AnnotationUniquenessValidationError,
|
||||
)
|
||||
from superset.annotation_layers.commands.exceptions import AnnotationLayerNotFoundError
|
||||
from superset.commands.annotation_layer.exceptions import AnnotationLayerNotFoundError
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.annotation import AnnotationDAO, AnnotationLayerDAO
|
||||
from superset.daos.annotation_layer import AnnotationDAO, AnnotationLayerDAO
|
||||
from superset.daos.exceptions import DAOCreateFailedError
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -17,12 +17,12 @@
|
|||
import logging
|
||||
from typing import Optional
|
||||
|
||||
from superset.annotation_layers.annotations.commands.exceptions import (
|
||||
from superset.commands.annotation_layer.annotation.exceptions import (
|
||||
AnnotationDeleteFailedError,
|
||||
AnnotationNotFoundError,
|
||||
)
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.annotation import AnnotationDAO
|
||||
from superset.daos.annotation_layer import AnnotationDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.models.annotations import Annotation
|
||||
|
||||
|
|
@ -21,16 +21,16 @@ from typing import Any, Optional
|
|||
from flask_appbuilder.models.sqla import Model
|
||||
from marshmallow import ValidationError
|
||||
|
||||
from superset.annotation_layers.annotations.commands.exceptions import (
|
||||
from superset.commands.annotation_layer.annotation.exceptions import (
|
||||
AnnotationDatesValidationError,
|
||||
AnnotationInvalidError,
|
||||
AnnotationNotFoundError,
|
||||
AnnotationUniquenessValidationError,
|
||||
AnnotationUpdateFailedError,
|
||||
)
|
||||
from superset.annotation_layers.commands.exceptions import AnnotationLayerNotFoundError
|
||||
from superset.commands.annotation_layer.exceptions import AnnotationLayerNotFoundError
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.annotation import AnnotationDAO, AnnotationLayerDAO
|
||||
from superset.daos.annotation_layer import AnnotationDAO, AnnotationLayerDAO
|
||||
from superset.daos.exceptions import DAOUpdateFailedError
|
||||
from superset.models.annotations import Annotation
|
||||
|
||||
|
|
@ -20,13 +20,13 @@ from typing import Any
|
|||
from flask_appbuilder.models.sqla import Model
|
||||
from marshmallow import ValidationError
|
||||
|
||||
from superset.annotation_layers.commands.exceptions import (
|
||||
from superset.commands.annotation_layer.exceptions import (
|
||||
AnnotationLayerCreateFailedError,
|
||||
AnnotationLayerInvalidError,
|
||||
AnnotationLayerNameUniquenessValidationError,
|
||||
)
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.annotation import AnnotationLayerDAO
|
||||
from superset.daos.annotation_layer import AnnotationLayerDAO
|
||||
from superset.daos.exceptions import DAOCreateFailedError
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -17,13 +17,13 @@
|
|||
import logging
|
||||
from typing import Optional
|
||||
|
||||
from superset.annotation_layers.commands.exceptions import (
|
||||
from superset.commands.annotation_layer.exceptions import (
|
||||
AnnotationLayerDeleteFailedError,
|
||||
AnnotationLayerDeleteIntegrityError,
|
||||
AnnotationLayerNotFoundError,
|
||||
)
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.annotation import AnnotationLayerDAO
|
||||
from superset.daos.annotation_layer import AnnotationLayerDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.models.annotations import AnnotationLayer
|
||||
|
||||
|
|
@ -20,14 +20,14 @@ from typing import Any, Optional
|
|||
from flask_appbuilder.models.sqla import Model
|
||||
from marshmallow import ValidationError
|
||||
|
||||
from superset.annotation_layers.commands.exceptions import (
|
||||
from superset.commands.annotation_layer.exceptions import (
|
||||
AnnotationLayerInvalidError,
|
||||
AnnotationLayerNameUniquenessValidationError,
|
||||
AnnotationLayerNotFoundError,
|
||||
AnnotationLayerUpdateFailedError,
|
||||
)
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.annotation import AnnotationLayerDAO
|
||||
from superset.daos.annotation_layer import AnnotationLayerDAO
|
||||
from superset.daos.exceptions import DAOUpdateFailedError
|
||||
from superset.models.annotations import AnnotationLayer
|
||||
|
||||
|
|
@ -23,13 +23,13 @@ from flask_appbuilder.models.sqla import Model
|
|||
from marshmallow import ValidationError
|
||||
|
||||
from superset import security_manager
|
||||
from superset.charts.commands.exceptions import (
|
||||
from superset.commands.base import BaseCommand, CreateMixin
|
||||
from superset.commands.chart.exceptions import (
|
||||
ChartCreateFailedError,
|
||||
ChartInvalidError,
|
||||
DashboardsForbiddenError,
|
||||
DashboardsNotFoundValidationError,
|
||||
)
|
||||
from superset.commands.base import BaseCommand, CreateMixin
|
||||
from superset.commands.utils import get_datasource_by_id
|
||||
from superset.daos.chart import ChartDAO
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
|
|
@ -19,11 +19,11 @@ from typing import Any
|
|||
|
||||
from flask_babel import gettext as _
|
||||
|
||||
from superset.charts.commands.exceptions import (
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.commands.chart.exceptions import (
|
||||
ChartDataCacheLoadError,
|
||||
ChartDataQueryFailedError,
|
||||
)
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.common.query_context import QueryContext
|
||||
from superset.exceptions import CacheLoadError
|
||||
|
||||
|
|
@ -20,13 +20,13 @@ from typing import Optional
|
|||
from flask_babel import lazy_gettext as _
|
||||
|
||||
from superset import security_manager
|
||||
from superset.charts.commands.exceptions import (
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.commands.chart.exceptions import (
|
||||
ChartDeleteFailedError,
|
||||
ChartDeleteFailedReportsExistError,
|
||||
ChartForbiddenError,
|
||||
ChartNotFoundError,
|
||||
)
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.chart import ChartDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.daos.report import ReportScheduleDAO
|
||||
|
|
@ -22,9 +22,9 @@ from collections.abc import Iterator
|
|||
|
||||
import yaml
|
||||
|
||||
from superset.charts.commands.exceptions import ChartNotFoundError
|
||||
from superset.commands.chart.exceptions import ChartNotFoundError
|
||||
from superset.daos.chart import ChartDAO
|
||||
from superset.datasets.commands.export import ExportDatasetsCommand
|
||||
from superset.commands.dataset.export import ExportDatasetsCommand
|
||||
from superset.commands.export.models import ExportModelsCommand
|
||||
from superset.models.slice import Slice
|
||||
from superset.utils.dict_import_export import EXPORT_VERSION
|
||||
|
|
@ -20,8 +20,8 @@ from typing import Any
|
|||
|
||||
from marshmallow.exceptions import ValidationError
|
||||
|
||||
from superset.charts.commands.importers import v1
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.commands.chart.importers import v1
|
||||
from superset.commands.exceptions import CommandInvalidError
|
||||
from superset.commands.importers.exceptions import IncorrectVersionError
|
||||
|
||||
|
|
@ -20,15 +20,15 @@ from typing import Any
|
|||
from marshmallow import Schema
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from superset.charts.commands.exceptions import ChartImportError
|
||||
from superset.charts.commands.importers.v1.utils import import_chart
|
||||
from superset.charts.schemas import ImportV1ChartSchema
|
||||
from superset.commands.chart.exceptions import ChartImportError
|
||||
from superset.commands.chart.importers.v1.utils import import_chart
|
||||
from superset.commands.database.importers.v1.utils import import_database
|
||||
from superset.commands.dataset.importers.v1.utils import import_dataset
|
||||
from superset.commands.importers.v1 import ImportModelsCommand
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.daos.chart import ChartDAO
|
||||
from superset.databases.commands.importers.v1.utils import import_database
|
||||
from superset.databases.schemas import ImportV1DatabaseSchema
|
||||
from superset.datasets.commands.importers.v1.utils import import_dataset
|
||||
from superset.datasets.schemas import ImportV1DatasetSchema
|
||||
|
||||
|
||||
|
|
@ -23,7 +23,8 @@ from flask_appbuilder.models.sqla import Model
|
|||
from marshmallow import ValidationError
|
||||
|
||||
from superset import security_manager
|
||||
from superset.charts.commands.exceptions import (
|
||||
from superset.commands.base import BaseCommand, UpdateMixin
|
||||
from superset.commands.chart.exceptions import (
|
||||
ChartForbiddenError,
|
||||
ChartInvalidError,
|
||||
ChartNotFoundError,
|
||||
|
|
@ -31,7 +32,6 @@ from superset.charts.commands.exceptions import (
|
|||
DashboardsNotFoundValidationError,
|
||||
DatasourceTypeUpdateRequiredValidationError,
|
||||
)
|
||||
from superset.commands.base import BaseCommand, UpdateMixin
|
||||
from superset.commands.utils import get_datasource_by_id
|
||||
from superset.daos.chart import ChartDAO
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
|
|
@ -21,12 +21,12 @@ from typing import Any, Optional, Union
|
|||
import simplejson as json
|
||||
from flask import g
|
||||
|
||||
from superset.charts.commands.exceptions import (
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.commands.chart.data.get_data_command import ChartDataCommand
|
||||
from superset.commands.chart.exceptions import (
|
||||
ChartInvalidError,
|
||||
WarmUpCacheChartNotFoundError,
|
||||
)
|
||||
from superset.charts.data.commands.get_data_command import ChartDataCommand
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.extensions import db
|
||||
from superset.models.slice import Slice
|
||||
from superset.utils.core import error_msg_from_exception
|
||||
|
|
@ -18,7 +18,7 @@ import logging
|
|||
from typing import Optional
|
||||
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.css_templates.commands.exceptions import (
|
||||
from superset.commands.css.exceptions import (
|
||||
CssTemplateDeleteFailedError,
|
||||
CssTemplateNotFoundError,
|
||||
)
|
||||
|
|
@ -21,14 +21,14 @@ from flask_appbuilder.models.sqla import Model
|
|||
from marshmallow import ValidationError
|
||||
|
||||
from superset.commands.base import BaseCommand, CreateMixin
|
||||
from superset.commands.utils import populate_roles
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
from superset.daos.exceptions import DAOCreateFailedError
|
||||
from superset.dashboards.commands.exceptions import (
|
||||
from superset.commands.dashboard.exceptions import (
|
||||
DashboardCreateFailedError,
|
||||
DashboardInvalidError,
|
||||
DashboardSlugExistsValidationError,
|
||||
)
|
||||
from superset.commands.utils import populate_roles
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
from superset.daos.exceptions import DAOCreateFailedError
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -21,15 +21,15 @@ from flask_babel import lazy_gettext as _
|
|||
|
||||
from superset import security_manager
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.daos.report import ReportScheduleDAO
|
||||
from superset.dashboards.commands.exceptions import (
|
||||
from superset.commands.dashboard.exceptions import (
|
||||
DashboardDeleteFailedError,
|
||||
DashboardDeleteFailedReportsExistError,
|
||||
DashboardForbiddenError,
|
||||
DashboardNotFoundError,
|
||||
)
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.daos.report import ReportScheduleDAO
|
||||
from superset.exceptions import SupersetSecurityException
|
||||
from superset.models.dashboard import Dashboard
|
||||
|
||||
|
|
@ -25,12 +25,12 @@ from collections.abc import Iterator
|
|||
|
||||
import yaml
|
||||
|
||||
from superset.charts.commands.export import ExportChartsCommand
|
||||
from superset.dashboards.commands.exceptions import DashboardNotFoundError
|
||||
from superset.dashboards.commands.importers.v1.utils import find_chart_uuids
|
||||
from superset.commands.chart.export import ExportChartsCommand
|
||||
from superset.commands.dashboard.exceptions import DashboardNotFoundError
|
||||
from superset.commands.dashboard.importers.v1.utils import find_chart_uuids
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
from superset.commands.export.models import ExportModelsCommand
|
||||
from superset.datasets.commands.export import ExportDatasetsCommand
|
||||
from superset.commands.dataset.export import ExportDatasetsCommand
|
||||
from superset.daos.dataset import DatasetDAO
|
||||
from superset.models.dashboard import Dashboard
|
||||
from superset.models.slice import Slice
|
||||
|
|
@ -20,13 +20,13 @@ from typing import cast, Optional
|
|||
from flask_appbuilder.models.sqla import Model
|
||||
|
||||
from superset import security_manager
|
||||
from superset.common.not_authorized_object import NotAuthorizedException
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
from superset.dashboards.commands.exceptions import DashboardNotFoundError
|
||||
from superset.dashboards.filter_sets.commands.exceptions import (
|
||||
from superset.commands.dashboard.exceptions import DashboardNotFoundError
|
||||
from superset.commands.dashboard.filter_set.exceptions import (
|
||||
FilterSetForbiddenError,
|
||||
FilterSetNotFoundError,
|
||||
)
|
||||
from superset.common.not_authorized_object import NotAuthorizedException
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
from superset.dashboards.filter_sets.consts import USER_OWNER_TYPE
|
||||
from superset.models.dashboard import Dashboard
|
||||
from superset.models.filter_set import FilterSet
|
||||
|
|
@ -20,13 +20,13 @@ from typing import Any
|
|||
from flask_appbuilder.models.sqla import Model
|
||||
|
||||
from superset import security_manager
|
||||
from superset.daos.dashboard import FilterSetDAO
|
||||
from superset.dashboards.filter_sets.commands.base import BaseFilterSetCommand
|
||||
from superset.dashboards.filter_sets.commands.exceptions import (
|
||||
from superset.commands.dashboard.filter_set.base import BaseFilterSetCommand
|
||||
from superset.commands.dashboard.filter_set.exceptions import (
|
||||
DashboardIdInconsistencyError,
|
||||
FilterSetCreateFailedError,
|
||||
UserIsNotDashboardOwnerError,
|
||||
)
|
||||
from superset.daos.dashboard import FilterSetDAO
|
||||
from superset.dashboards.filter_sets.consts import (
|
||||
DASHBOARD_ID_FIELD,
|
||||
DASHBOARD_OWNER_TYPE,
|
||||
|
|
@ -16,14 +16,14 @@
|
|||
# under the License.
|
||||
import logging
|
||||
|
||||
from superset.daos.dashboard import FilterSetDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.dashboards.filter_sets.commands.base import BaseFilterSetCommand
|
||||
from superset.dashboards.filter_sets.commands.exceptions import (
|
||||
from superset.commands.dashboard.filter_set.base import BaseFilterSetCommand
|
||||
from superset.commands.dashboard.filter_set.exceptions import (
|
||||
FilterSetDeleteFailedError,
|
||||
FilterSetForbiddenError,
|
||||
FilterSetNotFoundError,
|
||||
)
|
||||
from superset.daos.dashboard import FilterSetDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -19,12 +19,10 @@ from typing import Any
|
|||
|
||||
from flask_appbuilder.models.sqla import Model
|
||||
|
||||
from superset.commands.dashboard.filter_set.base import BaseFilterSetCommand
|
||||
from superset.commands.dashboard.filter_set.exceptions import FilterSetUpdateFailedError
|
||||
from superset.daos.dashboard import FilterSetDAO
|
||||
from superset.daos.exceptions import DAOUpdateFailedError
|
||||
from superset.dashboards.filter_sets.commands.base import BaseFilterSetCommand
|
||||
from superset.dashboards.filter_sets.commands.exceptions import (
|
||||
FilterSetUpdateFailedError,
|
||||
)
|
||||
from superset.dashboards.filter_sets.consts import OWNER_ID_FIELD, OWNER_TYPE_FIELD
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -18,12 +18,12 @@ from typing import cast
|
|||
|
||||
from flask import session
|
||||
|
||||
from superset.dashboards.filter_state.commands.utils import check_access
|
||||
from superset.commands.dashboard.filter_state.utils import check_access
|
||||
from superset.commands.temporary_cache.create import CreateTemporaryCacheCommand
|
||||
from superset.commands.temporary_cache.entry import Entry
|
||||
from superset.commands.temporary_cache.parameters import CommandParameters
|
||||
from superset.extensions import cache_manager
|
||||
from superset.key_value.utils import random_key
|
||||
from superset.temporary_cache.commands.create import CreateTemporaryCacheCommand
|
||||
from superset.temporary_cache.commands.entry import Entry
|
||||
from superset.temporary_cache.commands.parameters import CommandParameters
|
||||
from superset.temporary_cache.utils import cache_key
|
||||
from superset.utils.core import get_user_id
|
||||
|
||||
|
|
@ -16,12 +16,12 @@
|
|||
# under the License.
|
||||
from flask import session
|
||||
|
||||
from superset.dashboards.filter_state.commands.utils import check_access
|
||||
from superset.commands.dashboard.filter_state.utils import check_access
|
||||
from superset.commands.temporary_cache.delete import DeleteTemporaryCacheCommand
|
||||
from superset.commands.temporary_cache.entry import Entry
|
||||
from superset.commands.temporary_cache.exceptions import TemporaryCacheAccessDeniedError
|
||||
from superset.commands.temporary_cache.parameters import CommandParameters
|
||||
from superset.extensions import cache_manager
|
||||
from superset.temporary_cache.commands.delete import DeleteTemporaryCacheCommand
|
||||
from superset.temporary_cache.commands.entry import Entry
|
||||
from superset.temporary_cache.commands.exceptions import TemporaryCacheAccessDeniedError
|
||||
from superset.temporary_cache.commands.parameters import CommandParameters
|
||||
from superset.temporary_cache.utils import cache_key
|
||||
from superset.utils.core import get_user_id
|
||||
|
||||
|
|
@ -18,10 +18,10 @@ from typing import Optional
|
|||
|
||||
from flask import current_app as app
|
||||
|
||||
from superset.dashboards.filter_state.commands.utils import check_access
|
||||
from superset.commands.dashboard.filter_state.utils import check_access
|
||||
from superset.commands.temporary_cache.get import GetTemporaryCacheCommand
|
||||
from superset.commands.temporary_cache.parameters import CommandParameters
|
||||
from superset.extensions import cache_manager
|
||||
from superset.temporary_cache.commands.get import GetTemporaryCacheCommand
|
||||
from superset.temporary_cache.commands.parameters import CommandParameters
|
||||
from superset.temporary_cache.utils import cache_key
|
||||
|
||||
|
||||
|
|
@ -18,13 +18,13 @@ from typing import cast, Optional
|
|||
|
||||
from flask import session
|
||||
|
||||
from superset.dashboards.filter_state.commands.utils import check_access
|
||||
from superset.commands.dashboard.filter_state.utils import check_access
|
||||
from superset.commands.temporary_cache.entry import Entry
|
||||
from superset.commands.temporary_cache.exceptions import TemporaryCacheAccessDeniedError
|
||||
from superset.commands.temporary_cache.parameters import CommandParameters
|
||||
from superset.commands.temporary_cache.update import UpdateTemporaryCacheCommand
|
||||
from superset.extensions import cache_manager
|
||||
from superset.key_value.utils import random_key
|
||||
from superset.temporary_cache.commands.entry import Entry
|
||||
from superset.temporary_cache.commands.exceptions import TemporaryCacheAccessDeniedError
|
||||
from superset.temporary_cache.commands.parameters import CommandParameters
|
||||
from superset.temporary_cache.commands.update import UpdateTemporaryCacheCommand
|
||||
from superset.temporary_cache.utils import cache_key
|
||||
from superset.utils.core import get_user_id
|
||||
|
||||
|
|
@ -15,15 +15,15 @@
|
|||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
from superset.dashboards.commands.exceptions import (
|
||||
from superset.commands.dashboard.exceptions import (
|
||||
DashboardAccessDeniedError,
|
||||
DashboardNotFoundError,
|
||||
)
|
||||
from superset.temporary_cache.commands.exceptions import (
|
||||
from superset.commands.temporary_cache.exceptions import (
|
||||
TemporaryCacheAccessDeniedError,
|
||||
TemporaryCacheResourceNotFoundError,
|
||||
)
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
|
||||
|
||||
def check_access(resource_id: int) -> None:
|
||||
|
|
@ -21,9 +21,9 @@ from typing import Any
|
|||
from marshmallow.exceptions import ValidationError
|
||||
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.commands.dashboard.importers import v0, v1
|
||||
from superset.commands.exceptions import CommandInvalidError
|
||||
from superset.commands.importers.exceptions import IncorrectVersionError
|
||||
from superset.dashboards.commands.importers import v0, v1
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -26,8 +26,8 @@ from sqlalchemy.orm import make_transient, Session
|
|||
|
||||
from superset import db
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.commands.dataset.importers.v0 import import_dataset
|
||||
from superset.connectors.sqla.models import SqlaTable, SqlMetric, TableColumn
|
||||
from superset.datasets.commands.importers.v0 import import_dataset
|
||||
from superset.exceptions import DashboardImportException
|
||||
from superset.models.dashboard import Dashboard
|
||||
from superset.models.slice import Slice
|
||||
|
|
@ -21,21 +21,21 @@ from marshmallow import Schema
|
|||
from sqlalchemy.orm import Session
|
||||
from sqlalchemy.sql import select
|
||||
|
||||
from superset.charts.commands.importers.v1.utils import import_chart
|
||||
from superset.charts.schemas import ImportV1ChartSchema
|
||||
from superset.commands.importers.v1 import ImportModelsCommand
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
from superset.dashboards.commands.exceptions import DashboardImportError
|
||||
from superset.dashboards.commands.importers.v1.utils import (
|
||||
from superset.commands.chart.importers.v1.utils import import_chart
|
||||
from superset.commands.dashboard.exceptions import DashboardImportError
|
||||
from superset.commands.dashboard.importers.v1.utils import (
|
||||
find_chart_uuids,
|
||||
find_native_filter_datasets,
|
||||
import_dashboard,
|
||||
update_id_refs,
|
||||
)
|
||||
from superset.commands.database.importers.v1.utils import import_database
|
||||
from superset.commands.dataset.importers.v1.utils import import_dataset
|
||||
from superset.commands.importers.v1 import ImportModelsCommand
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
from superset.dashboards.schemas import ImportV1DashboardSchema
|
||||
from superset.databases.commands.importers.v1.utils import import_database
|
||||
from superset.databases.schemas import ImportV1DatabaseSchema
|
||||
from superset.datasets.commands.importers.v1.utils import import_dataset
|
||||
from superset.datasets.schemas import ImportV1DatasetSchema
|
||||
from superset.models.dashboard import dashboard_slices
|
||||
|
||||
|
|
@ -18,11 +18,11 @@ import logging
|
|||
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from superset.commands.dashboard.permalink.base import BaseDashboardPermalinkCommand
|
||||
from superset.commands.key_value.upsert import UpsertKeyValueCommand
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
from superset.dashboards.permalink.commands.base import BaseDashboardPermalinkCommand
|
||||
from superset.dashboards.permalink.exceptions import DashboardPermalinkCreateFailedError
|
||||
from superset.dashboards.permalink.types import DashboardPermalinkState
|
||||
from superset.key_value.commands.upsert import UpsertKeyValueCommand
|
||||
from superset.key_value.exceptions import KeyValueCodecEncodeException
|
||||
from superset.key_value.utils import encode_permalink_key, get_deterministic_uuid
|
||||
from superset.utils.core import get_user_id
|
||||
|
|
@ -19,12 +19,12 @@ from typing import Optional
|
|||
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from superset.commands.dashboard.exceptions import DashboardNotFoundError
|
||||
from superset.commands.dashboard.permalink.base import BaseDashboardPermalinkCommand
|
||||
from superset.commands.key_value.get import GetKeyValueCommand
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
from superset.dashboards.commands.exceptions import DashboardNotFoundError
|
||||
from superset.dashboards.permalink.commands.base import BaseDashboardPermalinkCommand
|
||||
from superset.dashboards.permalink.exceptions import DashboardPermalinkGetFailedError
|
||||
from superset.dashboards.permalink.types import DashboardPermalinkValue
|
||||
from superset.key_value.commands.get import GetKeyValueCommand
|
||||
from superset.key_value.exceptions import (
|
||||
KeyValueCodecDecodeException,
|
||||
KeyValueGetFailedError,
|
||||
|
|
@ -23,16 +23,16 @@ from marshmallow import ValidationError
|
|||
|
||||
from superset import security_manager
|
||||
from superset.commands.base import BaseCommand, UpdateMixin
|
||||
from superset.commands.utils import populate_roles
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
from superset.daos.exceptions import DAOUpdateFailedError
|
||||
from superset.dashboards.commands.exceptions import (
|
||||
from superset.commands.dashboard.exceptions import (
|
||||
DashboardForbiddenError,
|
||||
DashboardInvalidError,
|
||||
DashboardNotFoundError,
|
||||
DashboardSlugExistsValidationError,
|
||||
DashboardUpdateFailedError,
|
||||
)
|
||||
from superset.commands.utils import populate_roles
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
from superset.daos.exceptions import DAOUpdateFailedError
|
||||
from superset.exceptions import SupersetSecurityException
|
||||
from superset.extensions import db
|
||||
from superset.models.dashboard import Dashboard
|
||||
|
|
@ -23,22 +23,22 @@ from marshmallow import ValidationError
|
|||
|
||||
from superset import is_feature_enabled
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.database import DatabaseDAO
|
||||
from superset.daos.exceptions import DAOCreateFailedError
|
||||
from superset.databases.commands.exceptions import (
|
||||
from superset.commands.database.exceptions import (
|
||||
DatabaseConnectionFailedError,
|
||||
DatabaseCreateFailedError,
|
||||
DatabaseExistsValidationError,
|
||||
DatabaseInvalidError,
|
||||
DatabaseRequiredFieldValidationError,
|
||||
)
|
||||
from superset.databases.commands.test_connection import TestConnectionDatabaseCommand
|
||||
from superset.databases.ssh_tunnel.commands.create import CreateSSHTunnelCommand
|
||||
from superset.databases.ssh_tunnel.commands.exceptions import (
|
||||
from superset.commands.database.ssh_tunnel.create import CreateSSHTunnelCommand
|
||||
from superset.commands.database.ssh_tunnel.exceptions import (
|
||||
SSHTunnelCreateFailedError,
|
||||
SSHTunnelingNotEnabledError,
|
||||
SSHTunnelInvalidError,
|
||||
)
|
||||
from superset.commands.database.test_connection import TestConnectionDatabaseCommand
|
||||
from superset.daos.database import DatabaseDAO
|
||||
from superset.daos.exceptions import DAOCreateFailedError
|
||||
from superset.exceptions import SupersetErrorsException
|
||||
from superset.extensions import db, event_logger, security_manager
|
||||
|
||||
|
|
@ -20,15 +20,15 @@ from typing import Optional
|
|||
from flask_babel import lazy_gettext as _
|
||||
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.database import DatabaseDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.daos.report import ReportScheduleDAO
|
||||
from superset.databases.commands.exceptions import (
|
||||
from superset.commands.database.exceptions import (
|
||||
DatabaseDeleteDatasetsExistFailedError,
|
||||
DatabaseDeleteFailedError,
|
||||
DatabaseDeleteFailedReportsExistError,
|
||||
DatabaseNotFoundError,
|
||||
)
|
||||
from superset.daos.database import DatabaseDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.daos.report import ReportScheduleDAO
|
||||
from superset.models.core import Database
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -23,7 +23,7 @@ from collections.abc import Iterator
|
|||
|
||||
import yaml
|
||||
|
||||
from superset.databases.commands.exceptions import DatabaseNotFoundError
|
||||
from superset.commands.database.exceptions import DatabaseNotFoundError
|
||||
from superset.daos.database import DatabaseDAO
|
||||
from superset.commands.export.models import ExportModelsCommand
|
||||
from superset.models.core import Database
|
||||
|
|
@ -21,9 +21,9 @@ from typing import Any
|
|||
from marshmallow.exceptions import ValidationError
|
||||
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.commands.database.importers import v1
|
||||
from superset.commands.exceptions import CommandInvalidError
|
||||
from superset.commands.importers.exceptions import IncorrectVersionError
|
||||
from superset.databases.commands.importers import v1
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -20,12 +20,12 @@ from typing import Any
|
|||
from marshmallow import Schema
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from superset.commands.database.exceptions import DatabaseImportError
|
||||
from superset.commands.database.importers.v1.utils import import_database
|
||||
from superset.commands.dataset.importers.v1.utils import import_dataset
|
||||
from superset.commands.importers.v1 import ImportModelsCommand
|
||||
from superset.daos.database import DatabaseDAO
|
||||
from superset.databases.commands.exceptions import DatabaseImportError
|
||||
from superset.databases.commands.importers.v1.utils import import_database
|
||||
from superset.databases.schemas import ImportV1DatabaseSchema
|
||||
from superset.datasets.commands.importers.v1.utils import import_dataset
|
||||
from superset.datasets.schemas import ImportV1DatasetSchema
|
||||
|
||||
|
||||
|
|
@ -21,13 +21,13 @@ from flask_appbuilder.models.sqla import Model
|
|||
from marshmallow import ValidationError
|
||||
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.database import SSHTunnelDAO
|
||||
from superset.daos.exceptions import DAOCreateFailedError
|
||||
from superset.databases.ssh_tunnel.commands.exceptions import (
|
||||
from superset.commands.database.ssh_tunnel.exceptions import (
|
||||
SSHTunnelCreateFailedError,
|
||||
SSHTunnelInvalidError,
|
||||
SSHTunnelRequiredFieldValidationError,
|
||||
)
|
||||
from superset.daos.database import SSHTunnelDAO
|
||||
from superset.daos.exceptions import DAOCreateFailedError
|
||||
from superset.extensions import db, event_logger
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -19,13 +19,13 @@ from typing import Optional
|
|||
|
||||
from superset import is_feature_enabled
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.database import SSHTunnelDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.databases.ssh_tunnel.commands.exceptions import (
|
||||
from superset.commands.database.ssh_tunnel.exceptions import (
|
||||
SSHTunnelDeleteFailedError,
|
||||
SSHTunnelingNotEnabledError,
|
||||
SSHTunnelNotFoundError,
|
||||
)
|
||||
from superset.daos.database import SSHTunnelDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.databases.ssh_tunnel.models import SSHTunnel
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -20,14 +20,14 @@ from typing import Any, Optional
|
|||
from flask_appbuilder.models.sqla import Model
|
||||
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.database import SSHTunnelDAO
|
||||
from superset.daos.exceptions import DAOUpdateFailedError
|
||||
from superset.databases.ssh_tunnel.commands.exceptions import (
|
||||
from superset.commands.database.ssh_tunnel.exceptions import (
|
||||
SSHTunnelInvalidError,
|
||||
SSHTunnelNotFoundError,
|
||||
SSHTunnelRequiredFieldValidationError,
|
||||
SSHTunnelUpdateFailedError,
|
||||
)
|
||||
from superset.daos.database import SSHTunnelDAO
|
||||
from superset.daos.exceptions import DAOUpdateFailedError
|
||||
from superset.databases.ssh_tunnel.models import SSHTunnel
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -20,12 +20,12 @@ from typing import Any, cast
|
|||
from sqlalchemy.orm import lazyload, load_only
|
||||
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.daos.database import DatabaseDAO
|
||||
from superset.databases.commands.exceptions import (
|
||||
from superset.commands.database.exceptions import (
|
||||
DatabaseNotFoundError,
|
||||
DatabaseTablesUnexpectedError,
|
||||
)
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.daos.database import DatabaseDAO
|
||||
from superset.exceptions import SupersetException
|
||||
from superset.extensions import db, security_manager
|
||||
from superset.models.core import Database
|
||||
|
|
@ -27,15 +27,13 @@ from sqlalchemy.exc import DBAPIError, NoSuchModuleError
|
|||
|
||||
from superset import is_feature_enabled
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.database import DatabaseDAO, SSHTunnelDAO
|
||||
from superset.databases.commands.exceptions import (
|
||||
from superset.commands.database.exceptions import (
|
||||
DatabaseSecurityUnsafeError,
|
||||
DatabaseTestConnectionDriverError,
|
||||
DatabaseTestConnectionUnexpectedError,
|
||||
)
|
||||
from superset.databases.ssh_tunnel.commands.exceptions import (
|
||||
SSHTunnelingNotEnabledError,
|
||||
)
|
||||
from superset.commands.database.ssh_tunnel.exceptions import SSHTunnelingNotEnabledError
|
||||
from superset.daos.database import DatabaseDAO, SSHTunnelDAO
|
||||
from superset.databases.ssh_tunnel.models import SSHTunnel
|
||||
from superset.databases.utils import make_url_safe
|
||||
from superset.errors import ErrorLevel, SupersetErrorType
|
||||
|
|
@ -22,23 +22,23 @@ from marshmallow import ValidationError
|
|||
|
||||
from superset import is_feature_enabled
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.database import DatabaseDAO
|
||||
from superset.daos.exceptions import DAOCreateFailedError, DAOUpdateFailedError
|
||||
from superset.databases.commands.exceptions import (
|
||||
from superset.commands.database.exceptions import (
|
||||
DatabaseConnectionFailedError,
|
||||
DatabaseExistsValidationError,
|
||||
DatabaseInvalidError,
|
||||
DatabaseNotFoundError,
|
||||
DatabaseUpdateFailedError,
|
||||
)
|
||||
from superset.databases.ssh_tunnel.commands.create import CreateSSHTunnelCommand
|
||||
from superset.databases.ssh_tunnel.commands.exceptions import (
|
||||
from superset.commands.database.ssh_tunnel.create import CreateSSHTunnelCommand
|
||||
from superset.commands.database.ssh_tunnel.exceptions import (
|
||||
SSHTunnelCreateFailedError,
|
||||
SSHTunnelingNotEnabledError,
|
||||
SSHTunnelInvalidError,
|
||||
SSHTunnelUpdateFailedError,
|
||||
)
|
||||
from superset.databases.ssh_tunnel.commands.update import UpdateSSHTunnelCommand
|
||||
from superset.commands.database.ssh_tunnel.update import UpdateSSHTunnelCommand
|
||||
from superset.daos.database import DatabaseDAO
|
||||
from superset.daos.exceptions import DAOCreateFailedError, DAOUpdateFailedError
|
||||
from superset.extensions import db, security_manager
|
||||
from superset.models.core import Database
|
||||
from superset.utils.core import DatasourceType
|
||||
|
|
@ -21,13 +21,13 @@ from typing import Any, Optional
|
|||
from flask_babel import gettext as __
|
||||
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.database import DatabaseDAO
|
||||
from superset.databases.commands.exceptions import (
|
||||
from superset.commands.database.exceptions import (
|
||||
DatabaseOfflineError,
|
||||
DatabaseTestConnectionFailedError,
|
||||
InvalidEngineError,
|
||||
InvalidParametersError,
|
||||
)
|
||||
from superset.daos.database import DatabaseDAO
|
||||
from superset.databases.utils import make_url_safe
|
||||
from superset.db_engine_specs import get_engine_spec
|
||||
from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
|
||||
|
|
@ -22,8 +22,7 @@ from flask import current_app
|
|||
from flask_babel import gettext as __
|
||||
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.daos.database import DatabaseDAO
|
||||
from superset.databases.commands.exceptions import (
|
||||
from superset.commands.database.exceptions import (
|
||||
DatabaseNotFoundError,
|
||||
NoValidatorConfigFoundError,
|
||||
NoValidatorFoundError,
|
||||
|
|
@ -31,6 +30,7 @@ from superset.databases.commands.exceptions import (
|
|||
ValidatorSQLError,
|
||||
ValidatorSQLUnexpectedError,
|
||||
)
|
||||
from superset.daos.database import DatabaseDAO
|
||||
from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
|
||||
from superset.models.core import Database
|
||||
from superset.sql_validators import get_validator_by_name
|
||||
|
|
@ -19,14 +19,14 @@ from typing import Optional
|
|||
|
||||
from superset import security_manager
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.connectors.sqla.models import TableColumn
|
||||
from superset.daos.dataset import DatasetColumnDAO, DatasetDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.datasets.columns.commands.exceptions import (
|
||||
from superset.commands.dataset.columns.exceptions import (
|
||||
DatasetColumnDeleteFailedError,
|
||||
DatasetColumnForbiddenError,
|
||||
DatasetColumnNotFoundError,
|
||||
)
|
||||
from superset.connectors.sqla.models import TableColumn
|
||||
from superset.daos.dataset import DatasetColumnDAO, DatasetDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.exceptions import SupersetSecurityException
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -22,15 +22,15 @@ from marshmallow import ValidationError
|
|||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from superset.commands.base import BaseCommand, CreateMixin
|
||||
from superset.daos.dataset import DatasetDAO
|
||||
from superset.daos.exceptions import DAOCreateFailedError
|
||||
from superset.datasets.commands.exceptions import (
|
||||
from superset.commands.dataset.exceptions import (
|
||||
DatabaseNotFoundValidationError,
|
||||
DatasetCreateFailedError,
|
||||
DatasetExistsValidationError,
|
||||
DatasetInvalidError,
|
||||
TableNotFoundValidationError,
|
||||
)
|
||||
from superset.daos.dataset import DatasetDAO
|
||||
from superset.daos.exceptions import DAOCreateFailedError
|
||||
from superset.extensions import db
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -19,14 +19,14 @@ from typing import Optional
|
|||
|
||||
from superset import security_manager
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.daos.dataset import DatasetDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.datasets.commands.exceptions import (
|
||||
from superset.commands.dataset.exceptions import (
|
||||
DatasetDeleteFailedError,
|
||||
DatasetForbiddenError,
|
||||
DatasetNotFoundError,
|
||||
)
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.daos.dataset import DatasetDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.exceptions import SupersetSecurityException
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -23,16 +23,16 @@ from marshmallow import ValidationError
|
|||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from superset.commands.base import BaseCommand, CreateMixin
|
||||
from superset.commands.exceptions import DatasourceTypeInvalidError
|
||||
from superset.connectors.sqla.models import SqlaTable, SqlMetric, TableColumn
|
||||
from superset.daos.dataset import DatasetDAO
|
||||
from superset.daos.exceptions import DAOCreateFailedError
|
||||
from superset.datasets.commands.exceptions import (
|
||||
from superset.commands.dataset.exceptions import (
|
||||
DatasetDuplicateFailedError,
|
||||
DatasetExistsValidationError,
|
||||
DatasetInvalidError,
|
||||
DatasetNotFoundError,
|
||||
)
|
||||
from superset.commands.exceptions import DatasourceTypeInvalidError
|
||||
from superset.connectors.sqla.models import SqlaTable, SqlMetric, TableColumn
|
||||
from superset.daos.dataset import DatasetDAO
|
||||
from superset.daos.exceptions import DAOCreateFailedError
|
||||
from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
|
||||
from superset.exceptions import SupersetErrorException
|
||||
from superset.extensions import db
|
||||
|
|
@ -25,7 +25,7 @@ import yaml
|
|||
from superset.commands.export.models import ExportModelsCommand
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.daos.database import DatabaseDAO
|
||||
from superset.datasets.commands.exceptions import DatasetNotFoundError
|
||||
from superset.commands.dataset.exceptions import DatasetNotFoundError
|
||||
from superset.daos.dataset import DatasetDAO
|
||||
from superset.utils.dict_import_export import EXPORT_VERSION
|
||||
from superset.utils.file import get_filename
|
||||
|
|
@ -21,9 +21,9 @@ from typing import Any
|
|||
from marshmallow.exceptions import ValidationError
|
||||
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.commands.dataset.importers import v0, v1
|
||||
from superset.commands.exceptions import CommandInvalidError
|
||||
from superset.commands.importers.exceptions import IncorrectVersionError
|
||||
from superset.datasets.commands.importers import v0, v1
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -25,6 +25,8 @@ from sqlalchemy.orm.session import make_transient
|
|||
|
||||
from superset import db
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.commands.database.exceptions import DatabaseNotFoundError
|
||||
from superset.commands.dataset.exceptions import DatasetInvalidError
|
||||
from superset.commands.importers.exceptions import IncorrectVersionError
|
||||
from superset.connectors.sqla.models import (
|
||||
BaseDatasource,
|
||||
|
|
@ -32,8 +34,6 @@ from superset.connectors.sqla.models import (
|
|||
SqlMetric,
|
||||
TableColumn,
|
||||
)
|
||||
from superset.databases.commands.exceptions import DatabaseNotFoundError
|
||||
from superset.datasets.commands.exceptions import DatasetInvalidError
|
||||
from superset.models.core import Database
|
||||
from superset.utils.dict_import_export import DATABASES_KEY
|
||||
|
||||
|
|
@ -20,12 +20,12 @@ from typing import Any
|
|||
from marshmallow import Schema
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from superset.commands.database.importers.v1.utils import import_database
|
||||
from superset.commands.dataset.exceptions import DatasetImportError
|
||||
from superset.commands.dataset.importers.v1.utils import import_dataset
|
||||
from superset.commands.importers.v1 import ImportModelsCommand
|
||||
from superset.daos.dataset import DatasetDAO
|
||||
from superset.databases.commands.importers.v1.utils import import_database
|
||||
from superset.databases.schemas import ImportV1DatabaseSchema
|
||||
from superset.datasets.commands.exceptions import DatasetImportError
|
||||
from superset.datasets.commands.importers.v1.utils import import_dataset
|
||||
from superset.datasets.schemas import ImportV1DatasetSchema
|
||||
|
||||
|
||||
|
|
@ -29,9 +29,9 @@ from sqlalchemy.orm.exc import MultipleResultsFound
|
|||
from sqlalchemy.sql.visitors import VisitableType
|
||||
|
||||
from superset import security_manager
|
||||
from superset.commands.dataset.exceptions import DatasetForbiddenDataURI
|
||||
from superset.commands.exceptions import ImportFailedError
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.datasets.commands.exceptions import DatasetForbiddenDataURI
|
||||
from superset.models.core import Database
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -19,14 +19,14 @@ from typing import Optional
|
|||
|
||||
from superset import security_manager
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.connectors.sqla.models import SqlMetric
|
||||
from superset.daos.dataset import DatasetDAO, DatasetMetricDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.datasets.metrics.commands.exceptions import (
|
||||
from superset.commands.dataset.metrics.exceptions import (
|
||||
DatasetMetricDeleteFailedError,
|
||||
DatasetMetricForbiddenError,
|
||||
DatasetMetricNotFoundError,
|
||||
)
|
||||
from superset.connectors.sqla.models import SqlMetric
|
||||
from superset.daos.dataset import DatasetDAO, DatasetMetricDAO
|
||||
from superset.daos.exceptions import DAODeleteFailedError
|
||||
from superset.exceptions import SupersetSecurityException
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -21,13 +21,13 @@ from flask_appbuilder.models.sqla import Model
|
|||
|
||||
from superset import security_manager
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.daos.dataset import DatasetDAO
|
||||
from superset.datasets.commands.exceptions import (
|
||||
from superset.commands.dataset.exceptions import (
|
||||
DatasetForbiddenError,
|
||||
DatasetNotFoundError,
|
||||
DatasetRefreshFailedError,
|
||||
)
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.daos.dataset import DatasetDAO
|
||||
from superset.exceptions import SupersetSecurityException
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -23,10 +23,7 @@ from marshmallow import ValidationError
|
|||
|
||||
from superset import security_manager
|
||||
from superset.commands.base import BaseCommand, UpdateMixin
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.daos.dataset import DatasetDAO
|
||||
from superset.daos.exceptions import DAOUpdateFailedError
|
||||
from superset.datasets.commands.exceptions import (
|
||||
from superset.commands.dataset.exceptions import (
|
||||
DatabaseChangeValidationError,
|
||||
DatasetColumnNotFoundValidationError,
|
||||
DatasetColumnsDuplicateValidationError,
|
||||
|
|
@ -40,6 +37,9 @@ from superset.datasets.commands.exceptions import (
|
|||
DatasetNotFoundError,
|
||||
DatasetUpdateFailedError,
|
||||
)
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.daos.dataset import DatasetDAO
|
||||
from superset.daos.exceptions import DAOUpdateFailedError
|
||||
from superset.exceptions import SupersetSecurityException
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue