Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
fix: Native filter dynamic numeric search (apache#24506)
Browse files Browse the repository at this point in the history
(cherry picked from commit b9824d6)
  • Loading branch information
john-bodley committed Jun 23, 2023
1 parent 9a438e8 commit e11c6ea
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 @@ -1802,13 +1802,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 != utils.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 e11c6ea

Please sign in to comment.