eschutho commented on a change in pull request #19083:
URL: https://github.com/apache/superset/pull/19083#discussion_r829261350



##########
File path: superset/sql_validators/presto_db.py
##########
@@ -55,7 +55,12 @@
         # Hook to allow environment-specific mutation (usually comments) to 
the SQL
         sql_query_mutator = config["SQL_QUERY_MUTATOR"]
         if sql_query_mutator:
-            sql = sql_query_mutator(sql, user_name, security_manager, database)
+            sql = sql_query_mutator(
+                sql,
+                user_name=user_name,

Review comment:
       Yes, the current user_name, or rather identifier. Sometimes it doesn't 
map directly to the person's name depending on how they've authenticated. 

##########
File path: tests/integration_tests/model_tests.py
##########
@@ -504,7 +504,7 @@ def test_sql_mutator(self):
         sql = tbl.get_query_str(query_obj)
         self.assertNotIn("-- COMMENT", sql)
 
-        def mutator(*args):
+        def mutator(*args, **kwargs):

Review comment:
       @hughhhh I added one more test to check that the database name is being 
passed in. LMK if you think more tests around that would be helpful. 
`user_name` was null and the `security_manager` is a function so printing them 
wouldn't really validate much. 




-- 
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: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to