Skip to content

Commit

Permalink
refactor for codeclimate limite
Browse files Browse the repository at this point in the history
  • Loading branch information
vera-liu committed Sep 12, 2016
1 parent e10f2fd commit b0e6f1a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions caravel/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,12 @@ def query_filters(self, is_having_filter=False):
extra_filters = json.loads(extra_filters)
for slice_filters in extra_filters.values():
for col, vals in slice_filters.items():
if col and vals:
if col in self.datasource.filterable_column_names:
# Quote values with comma to avoid conflict
vals = ["'%s'" % x if "," in x else x for x in vals]
filters += [(col, 'in', ",".join(vals))]
if not (col and vals):
continue
elif col in self.datasource.filterable_column_names:
# Quote values with comma to avoid conflict
vals = ["'%s'" % x if "," in x else x for x in vals]
filters += [(col, 'in', ",".join(vals))]
return filters

def query_obj(self):
Expand Down

0 comments on commit b0e6f1a

Please sign in to comment.