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

[explore] show the broken query when failing #1871

Merged
merged 3 commits into from
Jan 5, 2017

Conversation

mistercrunch
Copy link
Member

Currently when a query fails for whatever reason, the previous query is shown in the Query modal. It's confusing and makes it hard to debug things.

This PR addresses the problem both in v1 and v2, making sure the endpoint returns a rich json object that contains all the detail available even in case of failure.

Related improvements/refactor:

  • a better always function in explorev1, for logic that needs to happen on failure and success
  • more error handling in the backend
  • BaseViz now returns an data structure, not a json string, to allow the view to read what was returned and assign a proper error code
  • some cleanup of get_df methods for viz that really didn't need it, logic merged in get_data
  • ...

@@ -5,6 +5,7 @@

from datetime import datetime, timedelta
import json
import simplejson as sjson
Copy link

Choose a reason for hiding this comment

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

looks like we import this as import simplejson as json in other modules. i find sjson looks like a typo to me. either way, being consistent and importing simplejson the same var name seems like a good idea.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was avoiding the conflict as I moved the line import simplejson as json line from another file but can simply import simplejson

@ascott
Copy link

ascott commented Jan 4, 2017

generally lgtm.

@mistercrunch mistercrunch merged commit c14c7ed into apache:master Jan 5, 2017
@mistercrunch mistercrunch deleted the return_sql branch January 5, 2017 18:00
SalehHindi pushed a commit to SalehHindi/superset that referenced this pull request Jun 9, 2017
* Return query when failing

* Linting

* sjson -> simplejson
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.15.2 labels Feb 20, 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.15.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants