nytai commented on a change in pull request #9435: [dashboards] New, tittle and 
slug OR filter
URL: 
https://github.com/apache/incubator-superset/pull/9435#discussion_r404249388
 
 

 ##########
 File path: superset/dashboards/filters.py
 ##########
 @@ -23,6 +24,20 @@
 from superset.views.base import BaseFilter, get_user_roles
 
 
+class DashboardTitleOrSlugFilter(BaseFilter):  # pylint: 
disable=too-few-public-methods
+    name = _("Title or Slug")
+    arg_name = "title_or_slug"
+
+    def apply(self, query, value):
+        ilike_value = f"%{value}%"
 
 Review comment:
   we may want to handle `None` or `''` cases here and not apply the filter. I 
think running an `ilike %%` can be very slow on some dbs. I can handle these 
cases before issuing the request, however we may want some protection via the 
api. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to