refactor(chart.commands): separate commands into two different modules (#17509)

refactor: move imports under TYPE_CHECKING
This commit is contained in:
ofekisr
2021-11-22 19:57:52 +02:00
committed by GitHub
parent b750204984
commit 16e012fe5d
9 changed files with 70 additions and 26 deletions

View File

@@ -14,7 +14,9 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from typing import List, Optional
from __future__ import annotations
from typing import List, Optional, TYPE_CHECKING
from flask_appbuilder.security.sqla.models import Role, User
@@ -23,11 +25,13 @@ from superset.commands.exceptions import (
OwnersNotFoundValidationError,
RolesNotFoundValidationError,
)
from superset.connectors.base.models import BaseDatasource
from superset.connectors.connector_registry import ConnectorRegistry
from superset.datasets.commands.exceptions import DatasetNotFoundError
from superset.extensions import db, security_manager
if TYPE_CHECKING:
from superset.connectors.base.models import BaseDatasource
def populate_owners(
user: User, owner_ids: Optional[List[int]], default_to_user: bool,