mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
[explore] fix IN filter on numeric field (#2908)
This commit is contained in:
committed by
GitHub
parent
e0dd5d9d1d
commit
65f25a1e5a
@@ -477,22 +477,23 @@ class SqlaTable(Model, BaseDatasource):
|
||||
if op == 'not in':
|
||||
cond = ~cond
|
||||
where_clause_and.append(cond)
|
||||
if col_obj.is_num:
|
||||
eq = utils.string_to_num(flt['val'])
|
||||
if op == '==':
|
||||
where_clause_and.append(col_obj.sqla_col == eq)
|
||||
elif op == '!=':
|
||||
where_clause_and.append(col_obj.sqla_col != eq)
|
||||
elif op == '>':
|
||||
where_clause_and.append(col_obj.sqla_col > eq)
|
||||
elif op == '<':
|
||||
where_clause_and.append(col_obj.sqla_col < eq)
|
||||
elif op == '>=':
|
||||
where_clause_and.append(col_obj.sqla_col >= eq)
|
||||
elif op == '<=':
|
||||
where_clause_and.append(col_obj.sqla_col <= eq)
|
||||
elif op == 'LIKE':
|
||||
where_clause_and.append(col_obj.sqla_col.like(eq))
|
||||
else:
|
||||
if col_obj.is_num:
|
||||
eq = utils.string_to_num(flt['val'])
|
||||
if op == '==':
|
||||
where_clause_and.append(col_obj.sqla_col == eq)
|
||||
elif op == '!=':
|
||||
where_clause_and.append(col_obj.sqla_col != eq)
|
||||
elif op == '>':
|
||||
where_clause_and.append(col_obj.sqla_col > eq)
|
||||
elif op == '<':
|
||||
where_clause_and.append(col_obj.sqla_col < eq)
|
||||
elif op == '>=':
|
||||
where_clause_and.append(col_obj.sqla_col >= eq)
|
||||
elif op == '<=':
|
||||
where_clause_and.append(col_obj.sqla_col <= eq)
|
||||
elif op == 'LIKE':
|
||||
where_clause_and.append(col_obj.sqla_col.like(eq))
|
||||
if extras:
|
||||
where = extras.get('where')
|
||||
if where:
|
||||
|
||||
Reference in New Issue
Block a user