betodealmeida commented on code in PR #19999:
URL: https://github.com/apache/superset/pull/19999#discussion_r869108590


##########
superset/sql_lab.py:
##########
@@ -366,6 +386,10 @@ def execute_sql_statements(  # pylint: 
disable=too-many-arguments, too-many-loca
         # only asynchronous queries
         stats_logger.timing("sqllab.query.time_pending", now_as_float() - 
start_time)
 
+    if not hasattr(g, "user"):
+        # pylint: disable=assigning-non-slot
+        g.user = security_manager.find_user(username=user_name)

Review Comment:
   When I was testing, `g.user` was not set here or further down the stack, so 
the associated RLS rules were not being fetched. I assume this happens because 
the `execute_sql_statements` function is running either in Celery (if the DB is 
async) or in a separate thread (if the DB is sync).



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

Reply via email to