[sqllab] fix exception caused by casting string to int with psycopg2 (#9287)
* [sqllab] fix exception caused by casting string to int with psycopg2 * rollback session on exception * add SQLLAB_BACKEND_PERSISTENCE to default feature flags * cast tab_state_id to str in python instead of sql * remove import
This commit is contained in:
parent
b1916a190e
commit
8764ae3852
|
|
@ -285,6 +285,7 @@ DEFAULT_FEATURE_FLAGS = {
|
|||
"REDUCE_DASHBOARD_BOOTSTRAP_PAYLOAD": False,
|
||||
"SHARE_QUERIES_VIA_KV_STORE": False,
|
||||
"TAGGING_SYSTEM": False,
|
||||
"SQLLAB_BACKEND_PERSISTENCE": False,
|
||||
}
|
||||
|
||||
# This is merely a default.
|
||||
|
|
|
|||
|
|
@ -2704,7 +2704,7 @@ class Superset(BaseSupersetView):
|
|||
.filter_by(user_id=user_id)
|
||||
.all()
|
||||
)
|
||||
tab_state_ids = [tab_state[0] for tab_state in tabs_state]
|
||||
tab_state_ids = [str(tab_state[0]) for tab_state in tabs_state]
|
||||
# return first active tab, or fallback to another one if no tab is active
|
||||
active_tab = (
|
||||
db.session.query(TabState)
|
||||
|
|
@ -2728,7 +2728,7 @@ class Superset(BaseSupersetView):
|
|||
user_queries = (
|
||||
db.session.query(Query)
|
||||
.filter_by(user_id=user_id)
|
||||
.filter(Query.sql_editor_id.cast(Integer).in_(tab_state_ids))
|
||||
.filter(Query.sql_editor_id.in_(tab_state_ids))
|
||||
.all()
|
||||
)
|
||||
queries = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue