Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix sqlab progress bar and status inconsistency #5848

Merged

Conversation

youngyjd
Copy link
Contributor

@youngyjd youngyjd commented Sep 10, 2018

This is an example that progress bar says 100% finished, but status still says running
screen shot 2018-09-10 at 3 13 56 pm
This is because there is one more round of rendering going on in sqllab app to show data after it gets the query result.

In this PR, I introduced one more state regarding query status which is rendering. After query succeeds, the progress bar will now show 100% and the status will show rendering. It is more user friendly. This is what it looks like now:
screen shot 2018-09-10 at 3 24 01 pm

@codecov-io
Copy link

codecov-io commented Sep 10, 2018

Codecov Report

Merging #5848 into master will increase coverage by 0.43%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5848      +/-   ##
==========================================
+ Coverage   63.75%   64.18%   +0.43%     
==========================================
  Files         374      374              
  Lines       23320    23775     +455     
  Branches     2608     2624      +16     
==========================================
+ Hits        14867    15261     +394     
- Misses       8440     8501      +61     
  Partials       13       13
Impacted Files Coverage Δ
superset/assets/src/SqlLab/reducers.js 58.18% <ø> (ø) ⬆️
superset/assets/src/SqlLab/constants.js 100% <ø> (ø) ⬆️
.../assets/src/SqlLab/components/QueryAutoRefresh.jsx 52.5% <0%> (ø) ⬆️
...uperset/assets/src/SqlLab/components/ResultSet.jsx 87.36% <100%> (ø) ⬆️
superset/assets/src/welcome/App.jsx 0% <0%> (ø) ⬆️
superset/assets/src/welcome/DashboardTable.jsx 83.78% <0%> (+0.45%) ⬆️
superset/assets/src/SqlLab/actions.js 72.05% <0%> (+0.8%) ⬆️
superset/views/core.py 75.2% <0%> (+0.87%) ⬆️
superset/viz.py 82.57% <0%> (+1.14%) ⬆️
superset/stats_logger.py 64.44% <0%> (+2.22%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 73db918...cb92739. Read the comment docs.

@@ -200,7 +200,7 @@ export default class ResultSet extends React.PureComponent {
}
let progressBar;
let trackingUrl;
if (query.progress > 0 && query.state === 'running') {
if (query.progress > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we hide the progress bar after success?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -157,7 +157,7 @@ export const sqlLabReducer = function (state = {}, action) {
progress: 100,
results: action.results,
rows,
state: action.query.state,
state: 'rendering',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this where the code was setting state to success earlier?

Copy link
Contributor Author

@youngyjd youngyjd Sep 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Thanks for explaining.

@timifasubaa
Copy link
Contributor

LGTM

@mistercrunch
Copy link
Member

Often what takes time at 100% is the "push to s3" phase. Query is done, web server has the results, but it's pushing to s3. We may want to eventually introduce a new state for that.

Happy to merge this as is for now as it's better than before.

@youngyjd youngyjd closed this Sep 11, 2018
@youngyjd youngyjd reopened this Sep 11, 2018
@youngyjd
Copy link
Contributor Author

@kristw @timifasubaa @mistercrunch any clue on No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.?

@mistercrunch
Copy link
Member

@youngyjd this is just travis hiccups, I just restarted the 2 jobs that hung up.

@youngyjd
Copy link
Contributor Author

@mistercrunch @kristw @timifasubaa tests passed. should be ready to go.

@betodealmeida betodealmeida merged commit a0e7c17 into apache:master Sep 20, 2018
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 12, 2018
graceguo-supercat pushed a commit that referenced this pull request Jan 14, 2019
youngyjd added a commit to lyft/incubator-superset that referenced this pull request Jan 14, 2019
)

* revert 848

* nit

(cherry picked from commit b1dbd1c)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Jan 14, 2019
michellethomas pushed a commit that referenced this pull request Jan 14, 2019
* revert 848

* nit

(cherry picked from commit b1dbd1c)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Jan 17, 2019
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Jan 24, 2019
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Jan 30, 2019
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Jan 30, 2019
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Jan 30, 2019
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Jan 30, 2019
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Jan 30, 2019
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Jan 30, 2019
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants