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_r385253747
 
 

 ##########
 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.cast(Integer).in_(tab_state_ids))
 
 Review comment:
   @robdiciuccio with the persistence feature flag enabled the ID for each tab 
is autogenerated from the autoincrement key, so it's an int. But it could be a 
string instead, autogenerated in the backend. I opted for an int because it 
seems like a better solution for the long run, and tried to make the cast work 
everywhere.

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