mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
[sql lab] handle query stop race condition (#4928)
fixes https://github.com/apache/incubator-superset/issues/4926 In rare cases where the query is stopped before it is started, SQL Lab returns an unexpected string payload instead of a normal dictionary. This aligns the process to handle the error in a homogeneous fashion.
This commit is contained in:
committed by
GitHub
parent
a60d577b7d
commit
415d1c092b
@@ -232,13 +232,7 @@ def execute_sql(
|
||||
conn.close()
|
||||
|
||||
if query.status == utils.QueryStatus.STOPPED:
|
||||
return json.dumps(
|
||||
{
|
||||
'query_id': query.id,
|
||||
'status': query.status,
|
||||
'query': query.to_dict(),
|
||||
},
|
||||
default=utils.json_iso_dttm_ser)
|
||||
return handle_error('The query has been stopped')
|
||||
|
||||
cdf = convert_results_to_df(cursor_description, data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user