Skip to content

Commit

Permalink
chore: Update isort from 4.3 to 5.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bungoume committed May 4, 2021
1 parent 9a22fb0 commit 8e162af
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 19 deletions.
8 changes: 2 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@
# limitations under the License.
#
repos:
- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.3
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
- repo: https://github.com/pycqa/isort
rev: 5.8.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
Expand Down
2 changes: 1 addition & 1 deletion requirements/integration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pip-tools==5.3.1
# via pip-compile-multi
pluggy==0.13.1
# via tox
pre-commit==2.8.2
pre-commit==2.9.2
# via -r requirements/integration.in
py==1.9.0
# via tox
Expand Down
4 changes: 2 additions & 2 deletions superset/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ def init_views(self) -> None:
# pylint: disable=too-many-locals
# pylint: disable=too-many-statements
# pylint: disable=too-many-branches
from superset.annotation_layers.api import AnnotationLayerRestApi
from superset.annotation_layers.annotations.api import AnnotationRestApi
from superset.annotation_layers.api import AnnotationLayerRestApi
from superset.async_events.api import AsyncEventsRestApi
from superset.cachekeys.api import CacheRestApi
from superset.charts.api import ChartRestApi
Expand All @@ -153,10 +153,10 @@ def init_views(self) -> None:
from superset.datasets.columns.api import DatasetColumnsRestApi
from superset.datasets.metrics.api import DatasetMetricRestApi
from superset.queries.api import QueryRestApi
from superset.security.api import SecurityRestApi
from superset.queries.saved_queries.api import SavedQueryRestApi
from superset.reports.api import ReportScheduleRestApi
from superset.reports.logs.api import ReportExecutionLogRestApi
from superset.security.api import SecurityRestApi
from superset.views.access_requests import AccessRequestsModelView
from superset.views.alerts import (
AlertLogModelView,
Expand Down
3 changes: 2 additions & 1 deletion superset/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,10 +801,11 @@ def alert() -> None:
@with_appcontext
def update_api_docs() -> None:
"""Regenerate the openapi.json file in docs"""
from os import path

from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from flask_appbuilder.api import BaseApi
from os import path

superset_dir = path.abspath(path.dirname(__file__))
openapi_json = path.join(
Expand Down
6 changes: 3 additions & 3 deletions superset/security/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
from superset.common.query_context import QueryContext
from superset.connectors.base.models import BaseDatasource
from superset.connectors.druid.models import DruidCluster
from superset.models.dashboard import Dashboard
from superset.models.core import Database
from superset.models.dashboard import Dashboard
from superset.models.sql_lab import Query
from superset.sql_parse import Table
from superset.viz import BaseViz
Expand Down Expand Up @@ -1114,10 +1114,10 @@ def raise_for_dashboard_access(dashboard: "Dashboard") -> None:
:param dashboard: Dashboard the user wants access to
:raises DashboardAccessDeniedError: If the user cannot access the resource
"""
from superset import is_feature_enabled
from superset.dashboards.commands.exceptions import DashboardAccessDeniedError
from superset.views.base import get_user_roles, is_user_admin
from superset.views.utils import is_owner
from superset import is_feature_enabled

if is_feature_enabled("DASHBOARD_RBAC"):
has_rbac_access = any(
Expand All @@ -1137,8 +1137,8 @@ def raise_for_dashboard_access(dashboard: "Dashboard") -> None:
def can_access_based_on_dashboard(datasource: "BaseDatasource") -> bool:
from superset import db
from superset.dashboards.filters import DashboardAccessFilter
from superset.models.slice import Slice
from superset.models.dashboard import Dashboard
from superset.models.slice import Slice

datasource_class = type(datasource)
query = (
Expand Down
2 changes: 1 addition & 1 deletion superset/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Utility functions used across Superset"""
import _thread
import collections
import decimal
import errno
Expand Down Expand Up @@ -84,7 +85,6 @@
from sqlalchemy.types import TEXT, TypeDecorator, TypeEngine
from typing_extensions import TypedDict

import _thread # pylint: disable=C0411
from superset.constants import (
EXTRA_FORM_DATA_APPEND_KEYS,
EXTRA_FORM_DATA_OVERRIDE_EXTRA_KEYS,
Expand Down
4 changes: 1 addition & 3 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
Superset can render.
"""
import copy
import dataclasses
import inspect
import logging
import math
Expand Down Expand Up @@ -80,9 +81,6 @@
from superset.utils.dates import datetime_to_epoch
from superset.utils.hashing import md5_sha_from_str

import dataclasses # isort:skip


if TYPE_CHECKING:
from superset.connectors.base.models import BaseDatasource

Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/birth_names_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _load_data():
fetch_values_predicate="123 = 123",
)

from superset.examples.birth_names import create_slices, create_dashboard
from superset.examples.birth_names import create_dashboard, create_slices

slices, _ = create_slices(table, admin_owner=False)
dash = create_dashboard(slices)
Expand Down
3 changes: 2 additions & 1 deletion tests/reports/commands_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1367,9 +1367,10 @@ def test_grace_period_error_flap(
)
@patch("superset.reports.dao.ReportScheduleDAO.bulk_delete_logs")
def test_prune_log_soft_time_out(bulk_delete_logs, create_report_email_dashboard):
from celery.exceptions import SoftTimeLimitExceeded
from datetime import datetime, timedelta

from celery.exceptions import SoftTimeLimitExceeded

bulk_delete_logs.side_effect = SoftTimeLimitExceeded()
with pytest.raises(SoftTimeLimitExceeded) as excinfo:
AsyncPruneReportScheduleLogCommand().run()
Expand Down

0 comments on commit 8e162af

Please sign in to comment.