Skip to content

Commit

Permalink
adding fetching to query status (#15064)
Browse files Browse the repository at this point in the history
  • Loading branch information
AAfghahi committed Jun 9, 2021
1 parent 256e145 commit 2d3f552
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
19 changes: 13 additions & 6 deletions superset-frontend/src/SqlLab/components/QueryTable/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -268,14 +278,11 @@ const QueryTable = props => {
/>
);
q.state = (
<Tooltip
title={statusAttributes[q.state].config.label}
placement="bottom"
>
<Tooltip title={status.config.label} placement="bottom">
<span>
<StatusIcon
name={statusAttributes[q.state].config.name}
status={statusAttributes[q.state].config.status}
name={status.config.name}
status={status.config.status}
/>
</span>
</Tooltip>
Expand Down
1 change: 1 addition & 0 deletions superset-frontend/src/SqlLab/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export type QueryState =
| 'running'
| 'scheduled'
| 'success'
| 'fetching'
| 'timed_out';

export type Query = {
Expand Down
1 change: 1 addition & 0 deletions superset/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down

0 comments on commit 2d3f552

Please sign in to comment.