Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flake8] Resolving E7?? errors #3816

Merged
merged 1 commit into from
Nov 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def get_git_sha():
try:
s = str(subprocess.check_output(['git', 'rev-parse', 'HEAD']))
return s.strip()
except:
except Exception:
return ""

GIT_SHA = get_git_sha()
Expand Down
2 changes: 1 addition & 1 deletion superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ class CeleryConfig(object):
# Provide a callable that receives a tracking_url and returns another
# URL. This is used to translate internal Hadoop job tracker URL
# into a proxied one
TRACKING_URL_TRANSFORMER = lambda x: x
TRACKING_URL_TRANSFORMER = lambda x: x # noqa: E731

try:
if CONFIG_PATH_ENV_VAR in os.environ:
Expand Down
4 changes: 2 additions & 2 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def sqla_col(self):

def get_time_filter(self, start_dttm, end_dttm):
col = self.sqla_col.label('__time')
l = []
l = [] # noqa: E741
if start_dttm:
l.append(col >= text(self.dttm_sql_literal(start_dttm)))
if end_dttm:
Expand Down Expand Up @@ -228,7 +228,7 @@ def full_name(self):

@property
def dttm_cols(self):
l = [c.column_name for c in self.columns if c.is_dttm]
l = [c.column_name for c in self.columns if c.is_dttm] # noqa: E741
if self.main_dttm_col and self.main_dttm_col not in l:
l.append(self.main_dttm_col)
return l
Expand Down
8 changes: 4 additions & 4 deletions superset/db_engine_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def extract_error_message(cls, e):
try:
if isinstance(e.args, tuple) and len(e.args) > 1:
message = e.args[1]
except:
except Exception:
pass
return message

Expand Down Expand Up @@ -555,14 +555,14 @@ def _partition_query(
limit_clause = "LIMIT {}".format(limit) if limit else ''
order_by_clause = ''
if order_by:
l = []
l = [] # noqa: E741
for field, desc in order_by:
l.append(field + ' DESC' if desc else '')
order_by_clause = 'ORDER BY ' + ', '.join(l)

where_clause = ''
if filters:
l = []
l = [] # noqa: E741
for field, value in filters.items():
l.append("{field} = '{value}'".format(**locals()))
where_clause = 'WHERE ' + ' AND '.join(l)
Expand Down Expand Up @@ -728,7 +728,7 @@ def adjust_database_uri(cls, uri, selected_schema=None):
def extract_error_message(cls, e):
try:
msg = e.message.status.errorMessage
except:
except Exception:
msg = str(e)
return msg

Expand Down
2 changes: 1 addition & 1 deletion superset/models/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ def wrapper(*args, **kwargs):
params = ""
try:
params = json.dumps(d)
except:
except Exception:
pass
stats_logger.incr(f.__name__)
value = f(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1953,7 +1953,7 @@ def table(self, database_id, table_name, schema):
dtype = ""
try:
dtype = '{}'.format(col['type'])
except:
except Exception:
pass
cols.append({
'name': col['name'],
Expand Down
2 changes: 1 addition & 1 deletion superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ def get_data(self, df):
elif len(self.metrics) > 1:
series_title = ", ".join(name)
else:
l = [str(s) for s in name[1:]]
l = [str(s) for s in name[1:]] # noqa: E741
series_title = ", ".join(l)
values = []
for i, v in ys.iteritems():
Expand Down
2 changes: 1 addition & 1 deletion tests/core_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ def test_slice_query_endpoint(self):
resp = self.get_resp('/superset/slice_query/{}/'.format(slc.id))
assert 'query' in resp
assert 'language' in resp
self.logout();
self.logout()

def test_viz_get_fillna_for_columns(self):
slc = self.get_slice("Girls", db.session)
Expand Down
2 changes: 1 addition & 1 deletion tests/import_export_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def test_export_2_dashboards(self):
self.get_table_by_name('wb_health_population'), exported_tables[1])

def test_import_1_slice(self):
expected_slice = self.create_slice('Import Me', id=10001);
expected_slice = self.create_slice('Import Me', id=10001)
slc_id = models.Slice.import_obj(expected_slice, import_time=1989)
slc = self.get_slice(slc_id)
self.assertEquals(slc.datasource.perm, slc.perm)
Expand Down
2 changes: 1 addition & 1 deletion tests/viz_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_get_fillna_returns_default_on_null_columns(self):
'token': '12345',
}
datasource = {'type': 'table'}
test_viz = viz.BaseViz(datasource, form_data);
test_viz = viz.BaseViz(datasource, form_data)
self.assertEqual(
test_viz.default_fillna,
test_viz.get_fillna_for_columns(),
Expand Down
4 changes: 0 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ ignore =
E306
E402
E501
E722
E703
E731
E741
Q000
Q001
import-order-style = google
Expand Down