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

 ##########
 File path: superset/connectors/sqla/models.py
 ##########
 @@ -834,6 +843,10 @@ def get_sqla_query(  # sqla
                         where_clause_and.append(col_obj.get_sqla_col() == None)
                     elif op == "IS NOT NULL":
                         where_clause_and.append(col_obj.get_sqla_col() != None)
+
+        where_clause_and += [
+            text("({})".format(f)) for f in self._get_row_level_filters()
 
 Review comment:
   I think sqlalchemy should be doing the right thing here around parenthesis, 
so no need to add them explicitely
   
https://docs.sqlalchemy.org/en/13/core/sqlelement.html#sqlalchemy.sql.expression.BinaryExpression.self_group
   
   Something like 
   ```python
   where_clause_and += [text(f) for f in self._get_row_level_filters()]
   ```
   Oh and I guess the `text()` call could be in the method, could rename to 
`_get_sqla_row_level_filters`, so it's just `where_clause_and += 
self._get_row_level_filters()`

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