Skip to content

Commit

Permalink
Fixed codeclimate issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vera-liu committed Dec 9, 2016
1 parent 9ab4e7b commit 8de0fec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion superset/models.py
Expand Up @@ -1020,7 +1020,7 @@ def query( # sqla
"Datetime column not provided as part table configuration "
"and is required by this type of chart"))
for m in metrics:
if not m in metrics_dict:
if m not in metrics_dict:
raise Exception(_("Metric '{}' is not valid".format(m)))
metrics_exprs = [metrics_dict.get(m).sqla_col for m in metrics]
timeseries_limit_metric = metrics_dict.get(timeseries_limit_metric)
Expand Down
3 changes: 2 additions & 1 deletion superset/views.py
Expand Up @@ -2202,7 +2202,8 @@ def sqllab_viz(self):
if agg == 'count_distinct':
metrics.append(models.SqlMetric(
metric_name="{agg}__{column_name}".format(**locals()),
expression="COUNT(DISTINCT {column_name})".format(**locals()),
expression="COUNT(DISTINCT {column_name})"
.format(**locals()),
))
else:
metrics.append(models.SqlMetric(
Expand Down

0 comments on commit 8de0fec

Please sign in to comment.