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 2020/02/26 21:23:27 UTC

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

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

 ##########
 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:
   @betodealmeida we're seeing the following error due to the casting as an Integer:
   ```
   sqlalchemy.exc.DataError: (psycopg2.DataError) invalid input syntax for integer: "dKvEsdZdq"
   ```
   Any reason why `tab_state.id` should not be a `varchar` to match `query.sql_editor_id`?

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