You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/12/05 19:00:23 UTC

[GitHub] [incubator-superset] betodealmeida commented on a change in pull request #8769: Limit payload returned when using SQLLAB_BACKEND_PERSISTENCE

betodealmeida commented on a change in pull request #8769: Limit payload returned when using SQLLAB_BACKEND_PERSISTENCE
URL: https://github.com/apache/incubator-superset/pull/8769#discussion_r354491282
 
 

 ##########
 File path: superset/views/core.py
 ##########
 @@ -3093,26 +3092,38 @@ def sqllab(self):
                 }
                 for database in db.session.query(models.Database).all()
             }
+            # return all user queries associated with existing SQL editors
             user_queries = (
-                db.session.query(Query).filter_by(user_id=g.user.get_id()).all()
+                db.session.query(Query)
+                .filter_by(user_id=user_id)
+                .filter(Query.sql_editor_id.in_(tab_state_ids))
 
 Review comment:
   This line is the core change of this PR, filtering the queries.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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