mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore(command): Organize Commands according to SIP-92 (#25850)
This commit is contained in:
@@ -23,16 +23,16 @@ import yaml
|
||||
from werkzeug.utils import secure_filename
|
||||
|
||||
from superset import db, security_manager
|
||||
from superset.commands.exceptions import CommandInvalidError
|
||||
from superset.commands.importers.exceptions import IncorrectVersionError
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.dashboards.commands.exceptions import DashboardNotFoundError
|
||||
from superset.dashboards.commands.export import (
|
||||
from superset.commands.dashboard.exceptions import DashboardNotFoundError
|
||||
from superset.commands.dashboard.export import (
|
||||
append_charts,
|
||||
ExportDashboardsCommand,
|
||||
get_default_position,
|
||||
)
|
||||
from superset.dashboards.commands.importers import v0, v1
|
||||
from superset.commands.dashboard.importers import v0, v1
|
||||
from superset.commands.exceptions import CommandInvalidError
|
||||
from superset.commands.importers.exceptions import IncorrectVersionError
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.models.core import Database
|
||||
from superset.models.dashboard import Dashboard
|
||||
from superset.models.slice import Slice
|
||||
@@ -292,7 +292,7 @@ class TestExportDashboardsCommand(SupersetTestCase):
|
||||
]
|
||||
|
||||
@pytest.mark.usefixtures("load_world_bank_dashboard_with_slices")
|
||||
@patch("superset.dashboards.commands.export.suffix")
|
||||
@patch("superset.commands.dashboard.export.suffix")
|
||||
def test_append_charts(self, mock_suffix):
|
||||
"""Test that orphaned charts are added to the dashboard position"""
|
||||
# return deterministic IDs
|
||||
@@ -490,7 +490,7 @@ class TestImportDashboardsCommand(SupersetTestCase):
|
||||
db.session.delete(dataset)
|
||||
db.session.commit()
|
||||
|
||||
@patch("superset.dashboards.commands.importers.v1.utils.g")
|
||||
@patch("superset.commands.dashboard.importers.v1.utils.g")
|
||||
@patch("superset.security.manager.g")
|
||||
def test_import_v1_dashboard(self, sm_g, utils_g):
|
||||
"""Test that we can import a dashboard"""
|
||||
|
||||
@@ -22,10 +22,10 @@ from flask.ctx import AppContext
|
||||
from flask_appbuilder.security.sqla.models import User
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from superset.dashboards.commands.exceptions import DashboardAccessDeniedError
|
||||
from superset.commands.dashboard.exceptions import DashboardAccessDeniedError
|
||||
from superset.commands.temporary_cache.entry import Entry
|
||||
from superset.extensions import cache_manager
|
||||
from superset.models.dashboard import Dashboard
|
||||
from superset.temporary_cache.commands.entry import Entry
|
||||
from superset.temporary_cache.utils import cache_key
|
||||
from tests.integration_tests.fixtures.world_bank_dashboard import (
|
||||
load_world_bank_dashboard_with_slices,
|
||||
|
||||
@@ -23,7 +23,7 @@ from flask_appbuilder.security.sqla.models import User
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from superset import db
|
||||
from superset.dashboards.commands.exceptions import DashboardAccessDeniedError
|
||||
from superset.commands.dashboard.exceptions import DashboardAccessDeniedError
|
||||
from superset.key_value.models import KeyValueEntry
|
||||
from superset.key_value.types import KeyValueResource
|
||||
from superset.key_value.utils import decode_permalink_id
|
||||
|
||||
@@ -21,8 +21,8 @@ from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from superset.commands.dashboard.exceptions import DashboardForbiddenError
|
||||
from superset.daos.dashboard import DashboardDAO
|
||||
from superset.dashboards.commands.exceptions import DashboardForbiddenError
|
||||
from superset.utils.core import backend, override_user
|
||||
from tests.integration_tests.conftest import with_feature_flags
|
||||
from tests.integration_tests.dashboards.dashboard_test_utils import *
|
||||
|
||||
Reference in New Issue
Block a user