Repository: apache/superset
File: superset/models/helpers.py (Python)

Code before:
                elif op == utils.FilterOperator.IS_FALSE.value:
                    where_clause_and.append(
                        db_engine_spec.handle_boolean_filter(sqla_col, op, False)
                    )
                else:
                    if (
                        op
                        not in {
                            utils.FilterOperator.EQUALS.value,
                            utils.FilterOperator.NOT_EQUALS.value,
                        }
                        and eq is None
                    ):
                        raise QueryObjectValidationError(
                            _(
                                "Must specify a value for filters "
                                "with comparison operators"
                            )
                        )
                    if op in {
                        utils.FilterOperator.EQUALS.value,
                        utils.FilterOperator.NOT_EQUALS.value,
                        utils.FilterOperator.GREATER_THAN.value,
                        utils.FilterOperator.LESS_THAN.value,
                        utils.FilterOperator.GREATER_THAN_OR_EQUALS.value,
                        utils.FilterOperator.LESS_THAN_OR_EQUALS.value,
                    }:
                        where_clause_and.append(
                            db_engine_spec.handle_comparison_filter(sqla_col, op, eq)
                        )
                    elif op in {
                        utils.FilterOperator.ILIKE.value,
                        utils.FilterOperator.LIKE.value,
                    }:
                        if target_generic_type != GenericDataType.STRING:
                            sqla_col = sa.cast(sqla_col, sa.String)

                        if op == utils.FilterOperator.LIKE.value:
                            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)
                        and col_obj is not None
                    ):

Review comment (suggestion):
```suggestion
                        utils.FilterOperator.EQUALS,
                        utils.FilterOperator.NOT_EQUALS,
                        utils.FilterOperator.GREATER_THAN,
                        utils.FilterOperator.LESS_THAN,
                        utils.FilterOperator.GREATER_THAN_OR_EQUALS,
                        utils.FilterOperator.LESS_THAN_OR_EQUALS,
```

Code after:
                elif op == utils.FilterOperator.IS_FALSE:
                    where_clause_and.append(
                        db_engine_spec.handle_boolean_filter(sqla_col, op, False)
                    )
                else:
                    if (
                        op
                        not in {
                            utils.FilterOperator.EQUALS,
                            utils.FilterOperator.NOT_EQUALS,
                        }
                        and eq is None
                    ):
                        raise QueryObjectValidationError(
                            _(
                                "Must specify a value for filters "
                                "with comparison operators"
                            )
                        )
                    if op in {
                        utils.FilterOperator.EQUALS,
                        utils.FilterOperator.NOT_EQUALS,
                        utils.FilterOperator.GREATER_THAN,
                        utils.FilterOperator.LESS_THAN,
                        utils.FilterOperator.GREATER_THAN_OR_EQUALS,
                        utils.FilterOperator.LESS_THAN_OR_EQUALS,
                    }:
                        where_clause_and.append(
                            db_engine_spec.handle_comparison_filter(sqla_col, op, eq)
                        )
                    elif op in {
                        utils.FilterOperator.ILIKE,
                        utils.FilterOperator.LIKE,
                    }:
                        if target_generic_type != GenericDataType.STRING:
                            sqla_col = sa.cast(sqla_col, sa.String)

                        if op == utils.FilterOperator.LIKE:
                            where_clause_and.append(sqla_col.like(eq))
                        else:
                            where_clause_and.append(sqla_col.ilike(eq))
                    elif op in {utils.FilterOperator.NOT_LIKE}:
                        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
                        and isinstance(eq, str)
                        and col_obj is not None
                    ):