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/08 04:25:12 UTC
[incubator-superset] branch master updated: [flake8] Resolving W???
errors (#3784)
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 e822fb5 [flake8] Resolving W??? errors (#3784)
e822fb5 is described below
commit e822fb50d88152e46b70b2e26de0928d1aee3c19
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Tue Nov 7 20:25:10 2017 -0800
[flake8] Resolving W??? errors (#3784)
---
superset/security.py | 12 ++++++------
superset/sql_lab.py | 4 ++--
superset/utils.py | 4 ++--
tests/core_tests.py | 4 ++--
tests/security_tests.py | 1 -
tox.ini | 5 -----
6 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/superset/security.py b/superset/security.py
index 1175985..b1274f0 100644
--- a/superset/security.py
+++ b/superset/security.py
@@ -104,16 +104,16 @@ def get_or_create_main_db():
def is_admin_only(pvm):
# not readonly operations on read only model views allowed only for admins
- if (pvm.view_menu.name in READ_ONLY_MODEL_VIEWS
- and pvm.permission.name not in READ_ONLY_PERMISSION):
+ if (pvm.view_menu.name in READ_ONLY_MODEL_VIEWS and
+ pvm.permission.name not in READ_ONLY_PERMISSION):
return True
- return (pvm.view_menu.name in ADMIN_ONLY_VIEW_MENUS
- or pvm.permission.name in ADMIN_ONLY_PERMISSIONS)
+ return (pvm.view_menu.name in ADMIN_ONLY_VIEW_MENUS or
+ pvm.permission.name in ADMIN_ONLY_PERMISSIONS)
def is_alpha_only(pvm):
- if (pvm.view_menu.name in GAMMA_READ_ONLY_MODEL_VIEWS
- and pvm.permission.name not in READ_ONLY_PERMISSION):
+ if (pvm.view_menu.name in GAMMA_READ_ONLY_MODEL_VIEWS and
+ pvm.permission.name not in READ_ONLY_PERMISSION):
return True
return pvm.permission.name in ALPHA_ONLY_PERMISSIONS
diff --git a/superset/sql_lab.py b/superset/sql_lab.py
index 50bcc1b..dffa85c 100644
--- a/superset/sql_lab.py
+++ b/superset/sql_lab.py
@@ -153,8 +153,8 @@ def execute_sql(
query.user_id, start_dttm.strftime('%Y_%m_%d_%H_%M_%S'))
executed_sql = superset_query.as_create_table(query.tmp_table_name)
query.select_as_cta_used = True
- elif (query.limit and superset_query.is_select()
- and db_engine_spec.limit_method == LimitMethod.WRAP_SQL):
+ elif (query.limit and superset_query.is_select() and
+ db_engine_spec.limit_method == LimitMethod.WRAP_SQL):
executed_sql = database.wrap_sql_limit(executed_sql, query.limit)
query.limit_used = True
try:
diff --git a/superset/utils.py b/superset/utils.py
index 569147b..0bdf30d 100644
--- a/superset/utils.py
+++ b/superset/utils.py
@@ -377,8 +377,8 @@ def generic_find_constraint_name(table, columns, referenced, db):
t = sa.Table(table, db.metadata, autoload=True, autoload_with=db.engine)
for fk in t.foreign_key_constraints:
- if (fk.referred_table.name == referenced
- and set(fk.column_keys) == columns):
+ if (fk.referred_table.name == referenced and
+ set(fk.column_keys) == columns):
return fk.name
diff --git a/tests/core_tests.py b/tests/core_tests.py
index 41556d1..062da5e 100644
--- a/tests/core_tests.py
+++ b/tests/core_tests.py
@@ -695,8 +695,8 @@ class CoreTests(SupersetTestCase):
def test_fetch_datasource_metadata(self):
self.login(username='admin')
url = (
- '/superset/fetch_datasource_metadata?'
- + 'datasourceKey=1__table'
+ '/superset/fetch_datasource_metadata?' +
+ 'datasourceKey=1__table'
)
resp = self.get_json_resp(url)
keys = [
diff --git a/tests/security_tests.py b/tests/security_tests.py
index ac7e0c8..cb2ff63 100644
--- a/tests/security_tests.py
+++ b/tests/security_tests.py
@@ -168,4 +168,3 @@ class RolePermissionTests(SupersetTestCase):
self.assert_cannot_gamma(granter_set)
self.assert_cannot_alpha(granter_set)
-
diff --git a/tox.ini b/tox.ini
index 5e197a0..e94a5e7 100644
--- a/tox.ini
+++ b/tox.ini
@@ -47,11 +47,6 @@ ignore =
F405
Q000
Q001
- W291
- W292
- W293
- W391
- W503
import-order-style = google
max-line-length = 90
--
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <co...@superset.apache.org>'].