Skip to content

Commit

Permalink
fix: Pylint errors on master (apache#27710)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored Mar 27, 2024
1 parent 528946d commit 883e455
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
import numpy as np
import pandas as pd
import sqlalchemy as sa
from flask import escape, Markup
from flask_appbuilder import Model
from flask_appbuilder.security.sqla.models import User
from flask_babel import gettext as __, lazy_gettext as _
from jinja2.exceptions import TemplateError
from markupsafe import escape, Markup
from sqlalchemy import (
and_,
Boolean,
Expand Down
3 changes: 2 additions & 1 deletion superset/connectors/sqla/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
import logging
import re

from flask import flash, Markup, redirect
from flask import flash, redirect
from flask_appbuilder import CompactCRUDMixin, expose, permission_name
from flask_appbuilder.fields import QuerySelectField
from flask_appbuilder.fieldwidgets import Select2Widget
from flask_appbuilder.models.sqla.interface import SQLAInterface
from flask_appbuilder.security.decorators import has_access
from flask_babel import lazy_gettext as _
from markupsafe import Markup
from wtforms.validators import DataRequired, Regexp

from superset import db
Expand Down
3 changes: 2 additions & 1 deletion superset/models/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@
import sqlalchemy as sa
import sqlparse
import yaml
from flask import escape, g, Markup
from flask import g
from flask_appbuilder import Model
from flask_appbuilder.models.decorators import renders
from flask_appbuilder.models.mixins import AuditMixin
from flask_appbuilder.security.sqla.models import User
from flask_babel import lazy_gettext as _
from jinja2.exceptions import TemplateError
from markupsafe import escape, Markup
from sqlalchemy import and_, Column, or_, UniqueConstraint
from sqlalchemy.exc import MultipleResultsFound
from sqlalchemy.ext.declarative import declared_attr
Expand Down
3 changes: 2 additions & 1 deletion superset/models/sql_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@

import simplejson as json
import sqlalchemy as sqla
from flask import current_app, Markup
from flask import current_app
from flask_appbuilder import Model
from flask_appbuilder.models.decorators import renders
from flask_babel import gettext as __
from humanize import naturaltime
from jinja2.exceptions import TemplateError
from markupsafe import Markup
from sqlalchemy import (
Boolean,
Column,
Expand Down
4 changes: 1 addition & 3 deletions superset/tags/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import enum
from typing import TYPE_CHECKING

from flask import escape
from flask_appbuilder import Model
from markupsafe import escape
from sqlalchemy import (
Column,
Enum,
Expand Down Expand Up @@ -87,7 +87,6 @@ class ObjectType(enum.Enum):


class Tag(Model, AuditMixinNullable):

"""A tag attached to an object (query, chart, dashboard, or dataset)."""

__tablename__ = "tag"
Expand All @@ -106,7 +105,6 @@ class Tag(Model, AuditMixinNullable):


class TaggedObject(Model, AuditMixinNullable):

"""An association between an object and a tag."""

__tablename__ = "tagged_object"
Expand Down
3 changes: 2 additions & 1 deletion superset/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@
import sqlalchemy as sa
from cryptography.hazmat.backends import default_backend
from cryptography.x509 import Certificate, load_pem_x509_certificate
from flask import current_app, g, Markup, request
from flask import current_app, g, request
from flask_appbuilder import SQLA
from flask_appbuilder.security.sqla.models import User
from flask_babel import gettext as __
from flask_babel.speaklater import LazyString
from markupsafe import Markup
from pandas.api.types import infer_dtype
from pandas.core.dtypes.common import is_numeric_dtype
from sqlalchemy import event, exc, inspect, select, Text
Expand Down
2 changes: 1 addition & 1 deletion superset/utils/date_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
)
from superset.constants import InstantTimeComparison, LRU_CACHE_MAX_SIZE, NO_TIME_RANGE

ParserElement.enablePackrat()
ParserElement.enable_packrat()

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion superset/views/chart/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from flask import Markup
from flask_babel import lazy_gettext as _
from markupsafe import Markup

from superset.dashboards.filters import DashboardAccessFilter
from superset.views.chart.filters import SliceFilter
Expand Down
2 changes: 1 addition & 1 deletion superset/views/database/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# under the License.
import inspect

from flask import Markup
from flask_babel import lazy_gettext as _
from markupsafe import Markup
from sqlalchemy import MetaData

from superset import app, security_manager
Expand Down

0 comments on commit 883e455

Please sign in to comment.