superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: [flake8] Resolving E3?? errors (#3814)
Date Sat, 11 Nov 2017 01:52:36 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new ba96984  [flake8] Resolving E3?? errors (#3814)
ba96984 is described below

commit ba96984048487ee368392c3b81a8b221b6c161ff
Author: John Bodley <4567245+john-bodley@users.noreply.github.com>
AuthorDate: Fri Nov 10 17:52:34 2017 -0800

    [flake8] Resolving E3?? errors (#3814)
---
 setup.py                           |  1 +
 superset/connectors/druid/views.py |  5 +++++
 superset/connectors/sqla/models.py |  1 +
 superset/connectors/sqla/views.py  |  4 ++++
 superset/db_engine_specs.py        |  1 +
 superset/db_engines/hive.py        |  1 -
 superset/views/core.py             | 18 ++++++++++++++++++
 superset/views/sql_lab.py          |  2 ++
 tests/access_tests.py              |  1 -
 tests/base_tests.py                |  2 --
 tests/celery_tests.py              |  2 ++
 tests/core_tests.py                |  1 -
 tests/druid_tests.py               |  3 +++
 tests/email_tests.py               |  1 +
 tests/superset_test_config.py      |  2 ++
 tests/utils_tests.py               |  1 +
 tox.ini                            |  4 ----
 17 files changed, 41 insertions(+), 9 deletions(-)

diff --git a/setup.py b/setup.py
index 7b887ed..00df4b4 100644
--- a/setup.py
+++ b/setup.py
@@ -18,6 +18,7 @@ def get_git_sha():
     except Exception:
         return ""
 
+
 GIT_SHA = get_git_sha()
 version_info = {
     'GIT_SHA': GIT_SHA,
diff --git a/superset/connectors/druid/views.py b/superset/connectors/druid/views.py
index ade28c7..5293166 100644
--- a/superset/connectors/druid/views.py
+++ b/superset/connectors/druid/views.py
@@ -68,6 +68,7 @@ class DruidColumnInlineView(CompactCRUDMixin, SupersetModelView):  # noqa
     def post_add(self, col):
         self.post_update(col)
 
+
 appbuilder.add_view_no_menu(DruidColumnInlineView)
 
 
@@ -117,6 +118,7 @@ class DruidMetricInlineView(CompactCRUDMixin, SupersetModelView):  # noqa
         if metric.is_restricted:
             security.merge_perm(sm, 'metric_access', metric.get_perm())
 
+
 appbuilder.add_view_no_menu(DruidMetricInlineView)
 
 
@@ -155,6 +157,7 @@ class DruidClusterModelView(SupersetModelView, DeleteMixin):  # noqa
     def _delete(self, pk):
         DeleteMixin._delete(self, pk)
 
+
 appbuilder.add_view(
     DruidClusterModelView,
     name="Druid Clusters",
@@ -257,6 +260,7 @@ class DruidDatasourceModelView(DatasourceModelView, DeleteMixin):  # noqa
     def _delete(self, pk):
         DeleteMixin._delete(self, pk)
 
+
 appbuilder.add_view(
     DruidDatasourceModelView,
     "Druid Datasources",
@@ -303,6 +307,7 @@ class Druid(BaseSupersetView):
         """
         return self.refresh_datasources(refreshAll=False)
 
+
 appbuilder.add_view_no_menu(Druid)
 
 appbuilder.add_link(
diff --git a/superset/connectors/sqla/models.py b/superset/connectors/sqla/models.py
index 03fac8e..8c70db3 100644
--- a/superset/connectors/sqla/models.py
+++ b/superset/connectors/sqla/models.py
@@ -707,5 +707,6 @@ class SqlaTable(Model, BaseDatasource):
             query = query.filter_by(schema=schema)
         return query.all()
 
+
 sa.event.listen(SqlaTable, 'after_insert', set_perm)
 sa.event.listen(SqlaTable, 'after_update', set_perm)
diff --git a/superset/connectors/sqla/views.py b/superset/connectors/sqla/views.py
index 513dd5a..586c776 100644
--- a/superset/connectors/sqla/views.py
+++ b/superset/connectors/sqla/views.py
@@ -89,6 +89,8 @@ class TableColumnInlineView(CompactCRUDMixin, SupersetModelView):  # noqa
         'database_expression': _("Database Expression"),
         'type': _('Type'),
     }
+
+
 appbuilder.add_view_no_menu(TableColumnInlineView)
 
 
@@ -142,6 +144,7 @@ class SqlMetricInlineView(CompactCRUDMixin, SupersetModelView):  # noqa
         if metric.is_restricted:
             security.merge_perm(sm, 'metric_access', metric.get_perm())
 
+
 appbuilder.add_view_no_menu(SqlMetricInlineView)
 
 
@@ -284,6 +287,7 @@ class TableModelView(DatasourceModelView, DeleteMixin):  # noqa
         flash(msg, 'info')
         return redirect('/tablemodelview/list/')
 
+
 appbuilder.add_view(
     TableModelView,
     "Tables",
diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py
index 421ca03..136b659 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -886,6 +886,7 @@ class HiveEngineSpec(PrestoEngineSpec):
             configuration["hive.server2.proxy.user"] = username
         return configuration
 
+
 class MssqlEngineSpec(BaseEngineSpec):
     engine = 'mssql'
     epoch_to_dttm = "dateadd(S, {col}, '1970-01-01')"
diff --git a/superset/db_engines/hive.py b/superset/db_engines/hive.py
index 1a1f513..635a73b 100644
--- a/superset/db_engines/hive.py
+++ b/superset/db_engines/hive.py
@@ -3,7 +3,6 @@ from TCLIService import ttypes
 from thrift import Thrift
 
 
-
 # TODO: contribute back to pyhive.
 def fetch_logs(self, max_rows=1024,
                orientation=ttypes.TFetchOrientation.FETCH_NEXT):
diff --git a/superset/views/core.py b/superset/views/core.py
index 375a9ed..3cbe7a6 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -272,6 +272,7 @@ class DatabaseView(SupersetModelView, DeleteMixin):  # noqa
     def _delete(self, pk):
         DeleteMixin._delete(self, pk)
 
+
 appbuilder.add_link(
     'Import Dashboards',
     label=__("Import Dashboards"),
@@ -299,12 +300,14 @@ class DatabaseAsync(DatabaseView):
         'allow_run_async', 'allow_run_sync', 'allow_dml',
     ]
 
+
 appbuilder.add_view_no_menu(DatabaseAsync)
 
 
 class DatabaseTablesAsync(DatabaseView):
     list_columns = ['id', 'all_table_names', 'all_schema_names']
 
+
 appbuilder.add_view_no_menu(DatabaseTablesAsync)
 
 
@@ -324,6 +327,7 @@ class AccessRequestsModelView(SupersetModelView, DeleteMixin):
         'created_on': _("Created On"),
     }
 
+
 appbuilder.add_view(
     AccessRequestsModelView,
     "Access requests",
@@ -411,6 +415,7 @@ class SliceModelView(SupersetModelView, DeleteMixin):  # noqa
             }),
         )
 
+
 appbuilder.add_view(
     SliceModelView,
     "Slices",
@@ -429,6 +434,7 @@ class SliceAsync(SliceModelView):  # noqa
         'slice_link': _('Slice'),
     }
 
+
 appbuilder.add_view_no_menu(SliceAsync)
 
 
@@ -437,6 +443,7 @@ class SliceAddView(SliceModelView):  # noqa
         'id', 'slice_name', 'slice_link', 'viz_type',
         'owners', 'modified', 'changed_on']
 
+
 appbuilder.add_view_no_menu(SliceAddView)
 
 
@@ -554,6 +561,7 @@ class DashboardModelViewAsync(DashboardModelView):  # noqa
         'modified': _('Modified'),
     }
 
+
 appbuilder.add_view_no_menu(DashboardModelViewAsync)
 
 
@@ -569,6 +577,7 @@ class LogModelView(SupersetModelView):
         'json': _("JSON"),
     }
 
+
 appbuilder.add_view(
     LogModelView,
     "Action Log",
@@ -582,10 +591,12 @@ appbuilder.add_view(
 def health():
     return "OK"
 
+
 @app.route('/healthcheck')
 def healthcheck():
     return "OK"
 
+
 @app.route('/ping')
 def ping():
     return "OK"
@@ -619,6 +630,7 @@ class KV(BaseSupersetView):
             return json_error_response(e)
         return Response(kv.value, status=200)
 
+
 appbuilder.add_view_no_menu(KV)
 
 
@@ -652,6 +664,7 @@ class R(BaseSupersetView):
         flash(Markup(request.args.get("msg")), "info")
         return redirect(request.args.get("url"))
 
+
 appbuilder.add_view_no_menu(R)
 
 
@@ -2388,6 +2401,7 @@ class Superset(BaseSupersetView):
             return json_error_response(DATASOURCE_ACCESS_ERR, status=401)
         return self.get_query_string_response(viz_obj)
 
+
 appbuilder.add_view_no_menu(Superset)
 
 
@@ -2404,6 +2418,7 @@ class CssTemplateModelView(SupersetModelView, DeleteMixin):
 class CssTemplateAsyncModelView(CssTemplateModelView):
     list_columns = ['template_name', 'css']
 
+
 appbuilder.add_separator("Sources")
 appbuilder.add_view(
     CssTemplateModelView,
@@ -2426,6 +2441,7 @@ appbuilder.add_link(
     category='SQL Lab',
     category_label=__("SQL Lab"),
 )
+
 appbuilder.add_link(
     'Query Search',
     label=_("Query Search"),
@@ -2451,6 +2467,8 @@ class RegexConverter(BaseConverter):
     def __init__(self, url_map, *items):
         super(RegexConverter, self).__init__(url_map)
         self.regex = items[0]
+
+
 app.url_map.converters['regex'] = RegexConverter
 
 
diff --git a/superset/views/sql_lab.py b/superset/views/sql_lab.py
index 7748b87..06afb4e 100644
--- a/superset/views/sql_lab.py
+++ b/superset/views/sql_lab.py
@@ -20,6 +20,7 @@ class QueryView(SupersetModelView):
         'end_time': _('End Time'),
     }
 
+
 appbuilder.add_view(
     QueryView,
     "Queries",
@@ -70,6 +71,7 @@ class SavedQueryViewApi(SavedQueryView):
     add_columns = show_columns
     edit_columns = add_columns
 
+
 appbuilder.add_view_no_menu(SavedQueryViewApi)
 appbuilder.add_view_no_menu(SavedQueryView)
 
diff --git a/tests/access_tests.py b/tests/access_tests.py
index 5a8e8ee..437a75e 100644
--- a/tests/access_tests.py
+++ b/tests/access_tests.py
@@ -299,7 +299,6 @@ class RequestAccessTests(SupersetTestCase):
         ds = session.query(SqlaTable).filter_by(
             table_name='wb_health_population').first()
 
-
         ds.schema = 'temp_schema'
         security.merge_perm(
             sm, 'schema_access', ds.schema_perm)
diff --git a/tests/base_tests.py b/tests/base_tests.py
index 4ba5f81..f18dfe2 100644
--- a/tests/base_tests.py
+++ b/tests/base_tests.py
@@ -112,8 +112,6 @@ class SupersetTestCase(unittest.TestCase):
             session.add(druid_datasource2)
             session.commit()
 
-
-
     def get_table(self, table_id):
         return db.session.query(SqlaTable).filter_by(
             id=table_id).first()
diff --git a/tests/celery_tests.py b/tests/celery_tests.py
index b2681f2..a825b4d 100644
--- a/tests/celery_tests.py
+++ b/tests/celery_tests.py
@@ -30,6 +30,8 @@ class CeleryConfig(object):
     CELERY_RESULT_BACKEND = 'db+sqlite:///' + app.config.get('SQL_CELERY_RESULTS_DB_FILE_PATH')
     CELERY_ANNOTATIONS = {'sql_lab.add': {'rate_limit': '10/s'}}
     CONCURRENCY = 1
+
+
 app.config['CELERY_CONFIG'] = CeleryConfig
 
 
diff --git a/tests/core_tests.py b/tests/core_tests.py
index 6c3bae1..04f4746 100644
--- a/tests/core_tests.py
+++ b/tests/core_tests.py
@@ -181,7 +181,6 @@ class CoreTests(SupersetTestCase):
         assert slc.slice_name == new_slice_name
         db.session.delete(slc)
 
-
     def test_filter_endpoint(self):
         self.login(username='admin')
         slice_name = "Energy Sankey"
diff --git a/tests/druid_tests.py b/tests/druid_tests.py
index 09ecc87..b8250f3 100644
--- a/tests/druid_tests.py
+++ b/tests/druid_tests.py
@@ -16,10 +16,12 @@ from superset.connectors.druid.models import (
 )
 from .base_tests import SupersetTestCase
 
+
 class PickableMock(Mock):
     def __reduce__(self):
         return (Mock, ())
 
+
 SEGMENT_METADATA = [{
     "id": "some_id",
     "intervals": ["2013-05-13T00:00:00.000Z/2013-05-14T00:00:00.000Z"],
@@ -199,6 +201,7 @@ class DruidTests(SupersetTestCase):
                 },
             },
         }
+
         def check():
             resp = self.client.post('/superset/sync_druid/', data=json.dumps(cfg))
             druid_ds = (
diff --git a/tests/email_tests.py b/tests/email_tests.py
index 8213a6f..f7b33c9 100644
--- a/tests/email_tests.py
+++ b/tests/email_tests.py
@@ -117,5 +117,6 @@ class EmailSmtpTest(unittest.TestCase):
         assert not mock_smtp.called
         assert not mock_smtp_ssl.called
 
+
 if __name__ == '__main__':
     unittest.main()
diff --git a/tests/superset_test_config.py b/tests/superset_test_config.py
index d65c85f..4f8c32c 100644
--- a/tests/superset_test_config.py
+++ b/tests/superset_test_config.py
@@ -29,4 +29,6 @@ class CeleryConfig(object):
     CELERY_RESULT_BACKEND = 'db+sqlite:///' + SQL_CELERY_RESULTS_DB_FILE_PATH
     CELERY_ANNOTATIONS = {'sql_lab.add': {'rate_limit': '10/s'}}
     CONCURRENCY = 1
+
+
 CELERY_CONFIG = CeleryConfig
diff --git a/tests/utils_tests.py b/tests/utils_tests.py
index 22623aa..5096f80 100644
--- a/tests/utils_tests.py
+++ b/tests/utils_tests.py
@@ -12,6 +12,7 @@ from superset.utils import (
     SupersetException, validate_json, zlib_compress, zlib_decompress_to_string,
 )
 
+
 class UtilsTestCase(unittest.TestCase):
     def test_json_int_dttm_ser(self):
         dttm = datetime(2020, 1, 1)
diff --git a/tox.ini b/tox.ini
index ffdce84..fc926b9 100644
--- a/tox.ini
+++ b/tox.ini
@@ -17,10 +17,6 @@ exclude =
     superset/migrations
     superset/templates
 ignore =
-    E302
-    E303
-    E305
-    E306
     E501
     Q000
     Q001

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <commits@superset.apache.org>'].

Mime
View raw message