From ac6a092b4ceb46729a08292643dd603585425204 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt <33317356+villebro@users.noreply.github.com> Date: Mon, 18 Dec 2023 13:01:50 -0800 Subject: [PATCH] chore(sqlalchemy): import from correct path (#26301) --- superset/commands/dataset/importers/v1/utils.py | 2 +- superset/commands/importers/v1/examples.py | 2 +- superset/models/helpers.py | 2 +- superset/views/base_schemas.py | 2 +- superset/views/datasource/views.py | 3 +-- superset/views/utils.py | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/superset/commands/dataset/importers/v1/utils.py b/superset/commands/dataset/importers/v1/utils.py index c145cc50f91f9..5a9ac54714e02 100644 --- a/superset/commands/dataset/importers/v1/utils.py +++ b/superset/commands/dataset/importers/v1/utils.py @@ -24,8 +24,8 @@ import pandas as pd from flask import current_app, g from sqlalchemy import BigInteger, Boolean, Date, DateTime, Float, String, Text +from sqlalchemy.exc import MultipleResultsFound from sqlalchemy.orm import Session -from sqlalchemy.orm.exc import MultipleResultsFound from sqlalchemy.sql.visitors import VisitableType from superset import security_manager diff --git a/superset/commands/importers/v1/examples.py b/superset/commands/importers/v1/examples.py index 94194921ac762..87280033ebbcd 100644 --- a/superset/commands/importers/v1/examples.py +++ b/superset/commands/importers/v1/examples.py @@ -17,8 +17,8 @@ from typing import Any from marshmallow import Schema +from sqlalchemy.exc import MultipleResultsFound from sqlalchemy.orm import Session -from sqlalchemy.orm.exc import MultipleResultsFound from sqlalchemy.sql import select from superset import db diff --git a/superset/models/helpers.py b/superset/models/helpers.py index 3e88bec44f9a3..d64b9036a49be 100644 --- a/superset/models/helpers.py +++ b/superset/models/helpers.py @@ -44,9 +44,9 @@ from flask_babel import lazy_gettext as _ from jinja2.exceptions import TemplateError from sqlalchemy import and_, Column, or_, UniqueConstraint +from sqlalchemy.exc import MultipleResultsFound from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm import Mapper, Session, validates -from sqlalchemy.orm.exc import MultipleResultsFound from sqlalchemy.sql.elements import ColumnElement, literal_column, TextClause from sqlalchemy.sql.expression import Label, Select, TextAsFrom from sqlalchemy.sql.selectable import Alias, TableClause diff --git a/superset/views/base_schemas.py b/superset/views/base_schemas.py index 5e423bde95377..0ad85f0ceb393 100644 --- a/superset/views/base_schemas.py +++ b/superset/views/base_schemas.py @@ -20,7 +20,7 @@ from flask import current_app, g from flask_appbuilder import Model from marshmallow import post_load, pre_load, Schema, ValidationError -from sqlalchemy.orm.exc import NoResultFound +from sqlalchemy.exc import NoResultFound from superset.utils.core import get_user_id diff --git a/superset/views/datasource/views.py b/superset/views/datasource/views.py index a4c158a11f300..b911d2ea3f116 100644 --- a/superset/views/datasource/views.py +++ b/superset/views/datasource/views.py @@ -24,8 +24,7 @@ from flask_appbuilder.security.decorators import has_access, has_access_api from flask_babel import _ from marshmallow import ValidationError -from sqlalchemy.exc import NoSuchTableError -from sqlalchemy.orm.exc import NoResultFound +from sqlalchemy.exc import NoResultFound, NoSuchTableError from superset import db, event_logger, security_manager from superset.commands.dataset.exceptions import ( diff --git a/superset/views/utils.py b/superset/views/utils.py index 7c25181194f11..db5b3b53467f5 100644 --- a/superset/views/utils.py +++ b/superset/views/utils.py @@ -28,7 +28,7 @@ from flask_appbuilder.security.sqla import models as ab_models from flask_appbuilder.security.sqla.models import User from flask_babel import _ -from sqlalchemy.orm.exc import NoResultFound +from sqlalchemy.exc import NoResultFound from werkzeug.wrappers.response import Response import superset.models.core as models