You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2017/11/09 04:34:24 UTC

[incubator-superset] branch master updated: [flake8] Resolving E2?? errors (#3812)

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 ec21d5a  [flake8] Resolving E2?? errors (#3812)
ec21d5a is described below

commit ec21d5af21f44aaa51105a7f952a26480c4c6830
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Wed Nov 8 20:34:23 2017 -0800

    [flake8] Resolving E2?? errors (#3812)
---
 superset/db_engine_specs.py   | 2 +-
 superset/views/core.py        | 2 +-
 superset/viz.py               | 6 +++---
 tests/access_tests.py         | 4 ++--
 tests/celery_tests.py         | 8 ++++----
 tests/db_engine_specs_test.py | 2 +-
 tests/sqllab_tests.py         | 4 ++--
 tests/viz_tests.py            | 2 +-
 tox.ini                       | 5 -----
 9 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py
index 1b71a75..ef317c9 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -649,7 +649,7 @@ class PrestoEngineSpec(BaseEngineSpec):
             msg = (
                 "A filter needs to be specified for {} out of the "
                 "{} fields."
-            ).format(len(part_fields)-1, len(part_fields))
+            ).format(len(part_fields) - 1, len(part_fields))
             raise SupersetTemplateException(msg)
 
         for field in part_fields:
diff --git a/superset/views/core.py b/superset/views/core.py
index ab2e3d4..0031150 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -1313,7 +1313,7 @@ class Superset(BaseSupersetView):
             max_tables = max_items * len(table_names) // total_items
             max_views = max_items * len(view_names) // total_items
 
-        table_options = [{'value': tn,  'label': tn}
+        table_options = [{'value': tn, 'label': tn}
                          for tn in table_names[:max_tables]]
         table_options.extend([{'value': vn, 'label': '[view] {}'.format(vn)}
                               for vn in view_names[:max_views]])
diff --git a/superset/viz.py b/superset/viz.py
index ab66401..f53ccbb 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -637,9 +637,9 @@ class CalHeatmapViz(BaseViz):
         elif domain == "week":
             range_ = diff_delta.years * 53 + diff_delta.weeks + 1
         elif domain == "day":
-            range_ = diff_secs // (24*60*60) + 1
+            range_ = diff_secs // (24 * 60 * 60) + 1
         else:
-            range_ = diff_secs // (60*60) + 1
+            range_ = diff_secs // (60 * 60) + 1
 
         return {
             "timestamps": timestamps,
@@ -1104,7 +1104,7 @@ class NVD3DualLineViz(NVD3Viz):
                     {'x': ds, 'y': ys[ds] if ds in ys else None}
                     for ds in df.index
                 ],
-                "yAxis": i+1,
+                "yAxis": i + 1,
                 "type": "line",
             }
             chart_data.append(d)
diff --git a/tests/access_tests.py b/tests/access_tests.py
index 1b950b5..8aa4c26 100644
--- a/tests/access_tests.py
+++ b/tests/access_tests.py
@@ -268,7 +268,7 @@ class RequestAccessTests(SupersetTestCase):
         ds_perm_view = sm.find_permission_view_menu(
             'database_access', database.perm)
         sm.add_permission_role(
-            sm.find_role(DB_ACCESS_ROLE) , ds_perm_view)
+            sm.find_role(DB_ACCESS_ROLE), ds_perm_view)
         gamma_user.roles.append(sm.find_role(DB_ACCESS_ROLE))
         session.commit()
         access_requests = self.get_access_requests('gamma', 'table', ds_1_id)
@@ -306,7 +306,7 @@ class RequestAccessTests(SupersetTestCase):
         schema_perm_view = sm.find_permission_view_menu(
             'schema_access', ds.schema_perm)
         sm.add_permission_role(
-            sm.find_role(SCHEMA_ACCESS_ROLE) , schema_perm_view)
+            sm.find_role(SCHEMA_ACCESS_ROLE), schema_perm_view)
         gamma_user.roles.append(sm.find_role(SCHEMA_ACCESS_ROLE))
         session.commit()
         # gamma2 request gets fulfilled
diff --git a/tests/celery_tests.py b/tests/celery_tests.py
index 8763ec1..0debe66 100644
--- a/tests/celery_tests.py
+++ b/tests/celery_tests.py
@@ -275,8 +275,8 @@ class CeleryTestCase(SupersetTestCase):
                 {'is_date': True, 'type': 'STRING', 'name': 'string2',
                     'is_dim': False},
                 {'is_date': False, 'type': 'STRING',
-                    'name': 'string3', 'is_dim': True}], 'name')
-                , cols,
+                    'name': 'string3', 'is_dim': True}], 'name'),
+                cols,
             )
         else:
             self.assertEqual(self.dictify_list_of_dicts([
@@ -295,8 +295,8 @@ class CeleryTestCase(SupersetTestCase):
                 {'is_date': True, 'type': 'STRING', 'name': 'string2',
                     'is_dim': False},
                 {'is_date': False, 'type': 'STRING',
-                    'name': 'string3', 'is_dim': True}], 'name')
-                , cols,
+                    'name': 'string3', 'is_dim': True}], 'name'),
+                cols,
             )
 
 
diff --git a/tests/db_engine_specs_test.py b/tests/db_engine_specs_test.py
index 67d5d0d..e348b90 100644
--- a/tests/db_engine_specs_test.py
+++ b/tests/db_engine_specs_test.py
@@ -10,7 +10,7 @@ from superset.db_engine_specs import HiveEngineSpec
 
 class DbEngineSpecsTestCase(unittest.TestCase):
     def test_0_progress(self):
-        log  = """
+        log = """
             17/02/07 18:26:27 INFO log.PerfLogger: <PERFLOG method=compile from=org.apache.hadoop.hive.ql.Driver>
             17/02/07 18:26:27 INFO log.PerfLogger: <PERFLOG method=parse from=org.apache.hadoop.hive.ql.Driver>
         """.split('\n')
diff --git a/tests/sqllab_tests.py b/tests/sqllab_tests.py
index e0b6701..c4332c9 100644
--- a/tests/sqllab_tests.py
+++ b/tests/sqllab_tests.py
@@ -111,7 +111,7 @@ class SqlLabTests(SupersetTestCase):
 
         data = self.get_json_resp(
             '/superset/queries/{}'.format(
-                int(utils.datetime_to_epoch(now))-1000))
+                int(utils.datetime_to_epoch(now)) - 1000))
         self.assertEquals(1, len(data))
 
         self.logout()
@@ -149,7 +149,7 @@ class SqlLabTests(SupersetTestCase):
             '/superset/search_queries?user_id={}'.format(user_id))
         data = json.loads(resp)
         self.assertEquals(1, len(data))
-        self.assertEquals(data[0]['userId'] , user_id)
+        self.assertEquals(data[0]['userId'], user_id)
 
     def test_search_query_on_status(self):
         self.run_some_queries()
diff --git a/tests/viz_tests.py b/tests/viz_tests.py
index 0aa0b6c..4b97027 100644
--- a/tests/viz_tests.py
+++ b/tests/viz_tests.py
@@ -104,7 +104,7 @@ class BaseVizTestCase(unittest.TestCase):
         self.assertEqual(156, test_viz.cache_timeout)
         datasource.cache_timeout = None
         datasource.database = Mock()
-        datasource.database.cache_timeout= 1666
+        datasource.database.cache_timeout = 1666
         self.assertEqual(1666, test_viz.cache_timeout)
 
 
diff --git a/tox.ini b/tox.ini
index b711dce..a810a4a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -27,11 +27,6 @@ ignore =
     E127
     E128
     E131
-    E203
-    E221
-    E225
-    E226
-    E241
     E302
     E303
     E305

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