diff --git a/superset-frontend/src/SqlLab/components/QueryTable/index.jsx b/superset-frontend/src/SqlLab/components/QueryTable/index.jsx index d23fd49ca6d..d53c9cff289 100644 --- a/superset-frontend/src/SqlLab/components/QueryTable/index.jsx +++ b/superset-frontend/src/SqlLab/components/QueryTable/index.jsx @@ -120,6 +120,14 @@ const statusAttributes = { status: 'queued', }, }, + error: { + color: ({ theme }) => theme.colors.error.base, + config: { + name: 'error', + label: t('Unknown Status'), + status: 'unknown status!', + }, + }, }; const StatusIcon = styled(Icon, { @@ -172,6 +180,8 @@ const QueryTable = props => { return props.queries .map(query => { const q = { ...query }; + const status = statusAttributes[q.state] || statusAttributes.error; + if (q.endDttm) { q.duration = fDuration(q.startDttm, q.endDttm); } @@ -268,14 +278,11 @@ const QueryTable = props => { /> ); q.state = ( - + diff --git a/superset-frontend/src/SqlLab/types.ts b/superset-frontend/src/SqlLab/types.ts index 593695919c5..a50d6640197 100644 --- a/superset-frontend/src/SqlLab/types.ts +++ b/superset-frontend/src/SqlLab/types.ts @@ -30,6 +30,7 @@ export type QueryState = | 'running' | 'scheduled' | 'success' + | 'fetching' | 'timed_out'; export type Query = { diff --git a/superset/utils/core.py b/superset/utils/core.py index 5ece0aeef6d..500f11a22c2 100644 --- a/superset/utils/core.py +++ b/superset/utils/core.py @@ -263,6 +263,7 @@ class QueryStatus(str, Enum): # pylint: disable=too-few-public-methods RUNNING: str = "running" SCHEDULED: str = "scheduled" SUCCESS: str = "success" + FETCHING: str = "fetching" TIMED_OUT: str = "timed_out"