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/03/12 22:17:53 UTC
[GitHub] [incubator-superset] nytai commented on a change in pull request
#9287: [sqllab] fix exception caused by casting string to int with psycopg2
nytai commented on a change in pull request #9287: [sqllab] fix exception caused by casting string to int with psycopg2
URL: https://github.com/apache/incubator-superset/pull/9287#discussion_r391935788
##########
File path: superset/views/core.py
##########
@@ -2704,13 +2705,19 @@ def _get_sqllab_payload(user_id: int) -> Dict[str, Any]:
}
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=user_id)
- .filter(Query.sql_editor_id.cast(Integer).in_(tab_state_ids))
Review comment:
Haha, that definitely works! Earlier I was trying to figure out how to craft some regex to filter out rows where sql_editor_id is not numeric... casting the ids to strings makes more sense 😄
----------------------------------------------------------------
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