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

Use POST in sqllab_viz instead of url params to avoid error with long queries #1933

Merged
merged 3 commits into from
Jan 11, 2017

Conversation

vera-liu
Copy link
Contributor

Issue:

  • we were passing sql query in url params for sqllab_viz, which could break for extremely long queries when url exceeds maximum characters allowed

Solution:

  • pass vizOptions through POST request, return url instead of redirect

needs-review @ascott @mistercrunch @bkyryliuk

@vera-liu vera-liu force-pushed the vliu_visualize_long_query branch from c507e7a to 23e177f Compare January 10, 2017 04:45
success: (url) => {
window.open(url);
},
error: (error) => {
Copy link
Member

@mistercrunch mistercrunch Jan 10, 2017

Choose a reason for hiding this comment

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

is this error handling better than no error handling? i think there's an action to add an alert that will be visible by the user

Copy link
Contributor Author

@vera-liu vera-liu Jan 11, 2017

Choose a reason for hiding this comment

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

since this is redirecting to a new explore page, adding alert in sqllab won't be intuitive, I'll delete this error handling.

@@ -2278,7 +2278,7 @@ def sqllab_viz(self):
}
params = "&".join([k + '=' + v for k, v in params.items() if v])
url = '/superset/explore/table/{table.id}/?{params}'.format(**locals())
return redirect(url)
return(url)
Copy link
Member

@mistercrunch mistercrunch Jan 11, 2017

Choose a reason for hiding this comment

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

return url, well actually, return '/superset/explore/table/{table.id}/?{params}'.format(**locals()) is better

@mistercrunch
Copy link
Member

LGTM after fixing the return statement

@vera-liu vera-liu force-pushed the vliu_visualize_long_query branch from faae07e to 808bd27 Compare January 11, 2017 18:06
@vera-liu vera-liu merged commit a385ee9 into apache:master Jan 11, 2017
SalehHindi pushed a commit to SalehHindi/superset that referenced this pull request Jun 9, 2017
… queries (apache#1933)

* Use POST in sqllab_viz instead of url params to avoid error with long queries

* Delete error handling

* Fix returning statement
@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