Skip to content

Commit

Permalink
[flake8] Adding future-import check (apache#4476)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-bodley authored and mistercrunch committed Feb 24, 2018
1 parent da172a0 commit 8c94a2f
Show file tree
Hide file tree
Showing 24 changed files with 124 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/permissions_cleanup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from collections import defaultdict

from superset import sm
Expand Down
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import json
import os
import subprocess
Expand Down
5 changes: 5 additions & 0 deletions superset/cache_util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from flask import request

from superset import tables_cache
Expand Down
5 changes: 5 additions & 0 deletions superset/connectors/base/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import json

from sqlalchemy import (
Expand Down
5 changes: 5 additions & 0 deletions superset/connectors/base/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from flask import Markup

from superset.utils import SupersetException
Expand Down
5 changes: 5 additions & 0 deletions superset/connectors/connector_registry.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from sqlalchemy.orm import subqueryload


Expand Down
5 changes: 5 additions & 0 deletions superset/connectors/druid/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# pylint: disable=invalid-unary-operand-type
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from collections import OrderedDict
from copy import deepcopy
from datetime import datetime, timedelta
Expand Down
5 changes: 5 additions & 0 deletions superset/connectors/druid/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from datetime import datetime
import json
import logging
Expand Down
5 changes: 5 additions & 0 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from datetime import datetime
import logging

Expand Down
5 changes: 5 additions & 0 deletions superset/connectors/sqla/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
"""Views used by the SqlAlchemy connector"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from flask import flash, Markup, redirect
from flask_appbuilder import CompactCRUDMixin, expose
from flask_appbuilder.actions import action
Expand Down
5 changes: 5 additions & 0 deletions superset/db_engines/hive.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from pyhive import hive
from TCLIService import ttypes
from thrift import Thrift
Expand Down
5 changes: 5 additions & 0 deletions superset/db_engines/presto.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from pyhive import presto


Expand Down
5 changes: 5 additions & 0 deletions superset/dict_import_export_util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import logging

from superset.connectors.druid.models import DruidCluster
Expand Down
4 changes: 4 additions & 0 deletions superset/extract_table_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
#
# See:
# http://groups.google.com/group/sqlparse/browse_thread/thread/b0bd9a022e9d4895
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import sqlparse
from sqlparse.sql import Identifier, IdentifierList
Expand Down
5 changes: 5 additions & 0 deletions superset/import_util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import logging

from sqlalchemy.orm.session import make_transient
Expand Down
5 changes: 5 additions & 0 deletions superset/stats_logger.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import logging

from colorama import Fore, Style
Expand Down
5 changes: 5 additions & 0 deletions superset/views/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from datetime import datetime
import functools
import json
Expand Down
5 changes: 5 additions & 0 deletions superset/views/sql_lab.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from flask import g, redirect
from flask_appbuilder import expose
from flask_appbuilder.models.sqla.interface import SQLAInterface
Expand Down
5 changes: 5 additions & 0 deletions tests/druid_func_tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import json
import unittest

Expand Down
5 changes: 5 additions & 0 deletions tests/model_tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import unittest

from sqlalchemy.engine.url import make_url
Expand Down
5 changes: 5 additions & 0 deletions tests/security_tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from superset import app, security, sm
from .base_tests import SupersetTestCase

Expand Down
5 changes: 5 additions & 0 deletions tests/utils_tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from datetime import date, datetime, time, timedelta
from decimal import Decimal
import unittest
Expand Down
5 changes: 5 additions & 0 deletions tests/viz_tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from datetime import datetime
import unittest

Expand Down
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,17 @@ exclude =
superset/migrations
superset/templates
ignore =
FI12
FI15
FI16
FI17
FI50
FI51
FI53
FI54
import-order-style = google
max-line-length = 90
require-code = True

[global]
wheel_dir = {homedir}/.wheelhouse
Expand Down Expand Up @@ -57,6 +66,7 @@ commands =
deps =
flake8
flake8-commas
flake8-future-import
flake8-import-order
flake8-quotes

Expand Down

0 comments on commit 8c94a2f

Please sign in to comment.