Skip to content

Commit

Permalink
Temp hack to make druid filters work in dashboard (#2300)
Browse files Browse the repository at this point in the history
  • Loading branch information
vera-liu authored Mar 1, 2017
1 parent fc64a75 commit efff1ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ export default class Filter extends React.Component {
// switching filter value between array/string when needed
if (strFilterOps.indexOf(filter.op) !== -1) {
// druid having filter or regex/==/!= filters
if (typeof filter.val !== 'string') {
this.props.changeFilter('val', filter.val.length > 0 ? filter.val[0] : '');
}
return (
<input
type="text"
Expand All @@ -113,9 +110,6 @@ export default class Filter extends React.Component {
/>
);
}
if (typeof filter.val === 'string') {
this.props.changeFilter('val', filter.val === '' ? [] : [filter.val]);
}
return (
<SelectControl
multi
Expand Down
2 changes: 2 additions & 0 deletions superset/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2579,6 +2579,8 @@ def get_filters(self, raw_filters):
cond = None
if op in ('in', 'not in'):
eq = [types.replace("'", '').strip() for types in eq]
elif not isinstance(flt['val'], basestring):
eq = eq[0] if len(eq) > 0 else ''
if col in self.num_cols:
if op in ('in', 'not in'):
eq = [utils.js_string_to_num(v) for v in eq]
Expand Down

0 comments on commit efff1ac

Please sign in to comment.