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

Confusing interface when both "Allow run Sync" and "Allow run Async" checked for datasource #5836

Closed
3 tasks done
ghost opened this issue Sep 6, 2018 · 2 comments
Closed
3 tasks done
Labels
inactive Inactive for >= 30 days

Comments

@ghost
Copy link

ghost commented Sep 6, 2018

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if any
  • I have reproduced the issue with at least the latest released version of superset
  • I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.28.0rc5

Expected results

The button displayed in the SQL Lab view's hover text corresponds with the actual type of execution that will happen. SqlEditor.runQuery() passes the proper argument into SqlEditor.startQuery()

Actual results

When you have a database that has both "Allow Run Sync" and "Allow Run Async" enabled, src/SqlLab/components/RunQueryActionButton.jsx:L67 will render the asyncBtn. The asyncBtn has the onClick action of SqlEditor.runQuery(true). This method, if I understand SqlEditor:L136 correctly, doesn't actually accept that parameter to do anything. Instead, it calls startQuery(!(this.props.database || {}).allow_run_sync). If you have allow_run_sync enabled, it runs startQuery(runAsync = false). Meaning that even though you have enabled async running on the database configuration, it still runs as sync. Basically, if I'm understanding the code correctly, this means that the "Allow Run Async" option is essentially useless, as it will always just execute !database.allow_run_sync.

However, if you toggle sync to effect the method of execution, the button rendered won't update to the correct version, meaning you can very easily end up with situations where the hover on the button says "Run Query Asynchronously" and it runs synchronously, or "Run Query Synchronously" and it runs async. This is confusing behavior.

I'll caveat all of this with a giant "I'm not great at JS" sticker however, so I very well could have misunderstood what's happening, even though I'm confident that the behavior is wrong.

Steps to reproduce

Set up an async backend. Create a datasource. Mark both "async" and "sync" in the database config. Run a SQL Lab query. Even though the button's hover text says "async", the arg passed in the form in POST for runAsync will be set to "false"

@mistercrunch
Copy link
Member

#4961

@stale
Copy link

stale bot commented Apr 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactive Inactive for >= 30 days
Projects
None yet
Development

No branches or pull requests

1 participant