feat: add support to NOT LIKE operator (#29384)
This commit is contained in:
parent
ee72d6cdca
commit
9724c99341
|
|
@ -30,6 +30,7 @@ const BINARY_OPERATORS = [
|
|||
'<=',
|
||||
'ILIKE',
|
||||
'LIKE',
|
||||
'NOT LIKE',
|
||||
'REGEX',
|
||||
'TEMPORAL_RANGE',
|
||||
] as const;
|
||||
|
|
|
|||
|
|
@ -1909,6 +1909,11 @@ class ExploreMixin: # pylint: disable=too-many-public-methods
|
|||
where_clause_and.append(sqla_col.like(eq))
|
||||
else:
|
||||
where_clause_and.append(sqla_col.ilike(eq))
|
||||
elif op in {utils.FilterOperator.NOT_LIKE.value}:
|
||||
if target_generic_type != GenericDataType.STRING:
|
||||
sqla_col = sa.cast(sqla_col, sa.String)
|
||||
|
||||
where_clause_and.append(sqla_col.not_like(eq))
|
||||
elif (
|
||||
op == utils.FilterOperator.TEMPORAL_RANGE.value
|
||||
and isinstance(eq, str)
|
||||
|
|
|
|||
|
|
@ -217,6 +217,7 @@ class FilterOperator(StrEnum):
|
|||
GREATER_THAN_OR_EQUALS = ">="
|
||||
LESS_THAN_OR_EQUALS = "<="
|
||||
LIKE = "LIKE"
|
||||
NOT_LIKE = "NOT LIKE"
|
||||
ILIKE = "ILIKE"
|
||||
IS_NULL = "IS NULL"
|
||||
IS_NOT_NULL = "IS NOT NULL"
|
||||
|
|
|
|||
Loading…
Reference in New Issue