youngyjd commented on a change in pull request #5848: fix sqlab progress bar
and status inconsistency
URL:
https://github.com/apache/incubator-superset/pull/5848#discussion_r216508457
##########
File path: superset/assets/src/SqlLab/reducers.js
##########
@@ -157,7 +157,7 @@ export const sqlLabReducer = function (state = {}, action)
{
progress: 100,
results: action.results,
rows,
- state: action.query.state,
+ state: 'rendering',
Review comment:
Nope. The `state` is still `running` and that's why the inconsistency
between progress bar and status happens.
So after query succeeds, the `action.results` is returned from the server
containing something like
```
{
'query': {
'id': ...,
'state': 'success',
'progress': 100,
...
}
'status': 'success'
}
```
but `action.query` itself is a part of the state of the app which contains
`{'state': 'running'}` field in itself.
Then in the next round of rerendering, the query data returned from the
server will show in the sqllab `SouthPane` and `state` will be updated in
`QueryAutoRefresh` from `running` to `success`:
https://github.com/apache/incubator-superset/blob/cb92739c46355c3217b33297cbcce8801f5768aa/superset/assets/src/SqlLab/components/QueryAutoRefresh.jsx#L45
So the inconsistency only exists during the period of rerendering, but users
are still able to to see it and get confused.
Please correct me if my understanding is wrong.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]