villebro commented on a change in pull request #16396:
URL: https://github.com/apache/superset/pull/16396#discussion_r693882334
##########
File path: superset/connectors/sqla/models.py
##########
@@ -1232,9 +1232,9 @@ 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 == utils.FilterOperator.LIKE.value:
- where_clause_and.append(sqla_col.like(eq))
+ where_clause_and.append(sqla_col.like(f"%{eq}%"))
Review comment:
As `LIKE` can do much more than just a "contains" match, and because
this would be a breaking change, I'd rather prefer something that allows the
user to write their own matching rule and not break backwards compatibility. Do
you think it would make sense to only append the leading and trailing `%` if
there are no unescaped `%` characters present in the like clause?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]