john-bodley commented on a change in pull request #8699: [SIP-29] Add support 
for row-level security
URL: 
https://github.com/apache/incubator-superset/pull/8699#discussion_r384747100
 
 

 ##########
 File path: superset/connectors/sqla/models.py
 ##########
 @@ -646,6 +646,19 @@ def adhoc_metric_to_sqla(self, metric: Dict, cols: Dict) 
-> Optional[Column]:
 
         return self.make_sqla_column_compatible(sqla_metric, label)
 
+    def _get_sqla_row_level_filters(self, template_processor) -> List[str]:
+        """
+        Return the appropriate row level security filters for this table and 
the current user.
+
+        :param BaseTemplateProcessor template_processor: The template 
processor to apply to the filters.
+        :returns: A list of SQL clauses to be ANDed together.
+        :rtype: List[str]
+        """
+        return [
+            text("({})".format(template_processor.process_template(f.clause)))
 
 Review comment:
   Could we use an `f` string here as opposed to `.format()`?

----------------------------------------------------------------
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