Skip to content

Commit

Permalink
fix: Native filter dynamic numeric search (apache#24506)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-bodley authored Jun 23, 2023
1 parent 2f91165 commit 03d6753
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions superset/models/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1852,13 +1852,13 @@ def get_sqla_query( # pylint: disable=too-many-arguments,too-many-locals,too-ma
elif op == utils.FilterOperator.LESS_THAN_OR_EQUALS.value:
where_clause_and.append(sqla_col <= eq)
elif op in {
utils.FilterOperator.ILIKE,
utils.FilterOperator.LIKE,
utils.FilterOperator.ILIKE.value,
utils.FilterOperator.LIKE.value,
}:
if target_generic_type != GenericDataType.STRING:
sqla_col = sa.cast(sqla_col, sa.String)

if utils.FilterOperator.LIKE.value:
if op == utils.FilterOperator.LIKE.value:
where_clause_and.append(sqla_col.like(eq))
else:
where_clause_and.append(sqla_col.ilike(eq))
Expand Down

0 comments on commit 03d6753

Please sign in to comment.