mistercrunch closed pull request #3812: [flake8] Resolving E2?? errors
URL: https://github.com/apache/incubator-superset/pull/3812
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py
index 1b71a75e04..ef317c9a23 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -649,7 +649,7 @@ def latest_sub_partition(cls, table_name, schema, database,
**kwargs):
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 ab2e3d434e..003115074c 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -1313,7 +1313,7 @@ def tables(self, db_id, schema, substr):
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 ab66401f8a..f53ccbbc2f 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -637,9 +637,9 @@ def get_data(self, df):
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 @@ def to_series(self, df, classed=''):
{'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 1b950b5175..8aa4c26206 100644
--- a/tests/access_tests.py
+++ b/tests/access_tests.py
@@ -268,7 +268,7 @@ def test_clean_requests_after_db_grant(self):
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 @@ def test_clean_requests_after_schema_grant(self):
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 8763ec1d3e..0debe66c3e 100644
--- a/tests/celery_tests.py
+++ b/tests/celery_tests.py
@@ -275,8 +275,8 @@ def test_get_columns(self):
{'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 @@ def test_get_columns(self):
{'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 67d5d0d022..e348b90324 100644
--- a/tests/db_engine_specs_test.py
+++ b/tests/db_engine_specs_test.py
@@ -10,7 +10,7 @@
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 e0b670193b..c4332c9823 100644
--- a/tests/sqllab_tests.py
+++ b/tests/sqllab_tests.py
@@ -111,7 +111,7 @@ def test_queries_endpoint(self):
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 @@ def test_search_query_on_user(self):
'/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 0aa0b6cc23..4b97027284 100644
--- a/tests/viz_tests.py
+++ b/tests/viz_tests.py
@@ -104,7 +104,7 @@ def test_cache_timeout(self):
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 b711dce38f..a810a4a5c6 100644
--- a/tox.ini
+++ b/tox.ini
@@ -27,11 +27,6 @@ ignore =
E127
E128
E131
- E203
- E221
- E225
- E226
- E241
E302
E303
E305
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services