mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
[ci] Deprecate flake8 (#8409)
* [ci] Deprecate flake8 * Addressing @villebro's comments
This commit is contained in:
committed by
Maxime Beauchemin
parent
a19990185d
commit
9fc37ea9f1
@@ -16,21 +16,23 @@
|
||||
# under the License.
|
||||
# pylint: disable=C,R,W
|
||||
"""A collection of ORM sqlalchemy models for Superset"""
|
||||
from contextlib import closing
|
||||
from copy import copy, deepcopy
|
||||
from datetime import datetime
|
||||
import json
|
||||
import logging
|
||||
import textwrap
|
||||
from contextlib import closing
|
||||
from copy import copy, deepcopy
|
||||
from datetime import datetime
|
||||
from typing import List
|
||||
from urllib import parse
|
||||
|
||||
import numpy
|
||||
import pandas as pd
|
||||
import sqlalchemy as sqla
|
||||
import sqlparse
|
||||
from flask import escape, g, Markup, request
|
||||
from flask_appbuilder import Model
|
||||
from flask_appbuilder.models.decorators import renders
|
||||
from flask_appbuilder.security.sqla.models import User
|
||||
import numpy
|
||||
import pandas as pd
|
||||
import sqlalchemy as sqla
|
||||
from sqlalchemy import (
|
||||
Boolean,
|
||||
Column,
|
||||
@@ -50,7 +52,6 @@ from sqlalchemy.orm.session import make_transient
|
||||
from sqlalchemy.pool import NullPool
|
||||
from sqlalchemy.schema import UniqueConstraint
|
||||
from sqlalchemy_utils import EncryptedType
|
||||
import sqlparse
|
||||
|
||||
from superset import app, db, db_engine_specs, is_feature_enabled, security_manager
|
||||
from superset.connectors.connector_registry import ConnectorRegistry
|
||||
@@ -60,7 +61,6 @@ from superset.models.tags import ChartUpdater, DashboardUpdater, FavStarUpdater
|
||||
from superset.models.user_attributes import UserAttribute
|
||||
from superset.utils import cache as cache_util, core as utils
|
||||
from superset.viz import viz_types
|
||||
from urllib import parse # noqa
|
||||
|
||||
config = app.config
|
||||
custom_password_store = config.get("SQLALCHEMY_CUSTOM_PASSWORD_STORE")
|
||||
@@ -71,7 +71,7 @@ metadata = Model.metadata # pylint: disable=no-member
|
||||
PASSWORD_MASK = "X" * 10
|
||||
|
||||
|
||||
def set_related_perm(mapper, connection, target): # noqa
|
||||
def set_related_perm(mapper, connection, target):
|
||||
src_class = target.cls_model
|
||||
id_ = target.datasource_id
|
||||
if id_:
|
||||
@@ -167,14 +167,14 @@ class Slice(Model, AuditMixinNullable, ImportMixin):
|
||||
perm = Column(String(1000))
|
||||
owners = relationship(security_manager.user_model, secondary=slice_user)
|
||||
|
||||
export_fields = (
|
||||
export_fields = [
|
||||
"slice_name",
|
||||
"datasource_type",
|
||||
"datasource_name",
|
||||
"viz_type",
|
||||
"params",
|
||||
"cache_timeout",
|
||||
)
|
||||
]
|
||||
|
||||
def __repr__(self):
|
||||
return self.slice_name or str(self.id)
|
||||
@@ -424,14 +424,14 @@ class Dashboard(Model, AuditMixinNullable, ImportMixin):
|
||||
owners = relationship(security_manager.user_model, secondary=dashboard_user)
|
||||
published = Column(Boolean, default=False)
|
||||
|
||||
export_fields = (
|
||||
export_fields = [
|
||||
"dashboard_title",
|
||||
"position_json",
|
||||
"json_metadata",
|
||||
"description",
|
||||
"css",
|
||||
"slug",
|
||||
)
|
||||
]
|
||||
|
||||
def __repr__(self):
|
||||
return self.dashboard_title or str(self.id)
|
||||
@@ -750,7 +750,7 @@ class Database(Model, AuditMixinNullable, ImportMixin):
|
||||
)
|
||||
perm = Column(String(1000))
|
||||
impersonate_user = Column(Boolean, default=False)
|
||||
export_fields = (
|
||||
export_fields = [
|
||||
"database_name",
|
||||
"sqlalchemy_uri",
|
||||
"cache_timeout",
|
||||
@@ -759,7 +759,7 @@ class Database(Model, AuditMixinNullable, ImportMixin):
|
||||
"allow_ctas",
|
||||
"allow_csv_upload",
|
||||
"extra",
|
||||
)
|
||||
]
|
||||
export_children = ["tables"]
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
Reference in New Issue
Block a user