diff --git a/superset/connectors/sqla/models.py b/superset/connectors/sqla/models.py index 894e8eef438..38b4a952951 100644 --- a/superset/connectors/sqla/models.py +++ b/superset/connectors/sqla/models.py @@ -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: