-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
Feature: query string API endpoint #3513
Feature: query string API endpoint #3513
Conversation
There's a bit of duplication of logic with what is going on here: https://github.com/apache/incubator-superset/blob/master/superset/views/core.py#L972 . What is the use-case for this endpoint? Perhaps we can add corresponding routing for One behavior that we want to have/preserve is around being able to reference a slice and override some elements easily. |
@mistercrunch is it alright if I just move the logic into a separate function? Redirecting to |
As for the use case: we want to be able to plug the generated query into other systems. |
79fc065
to
7fa4137
Compare
2 similar comments
superset/views/core.py
Outdated
@api | ||
@has_access_api | ||
@expose("/slice/<slice_id>/query/") | ||
def sliceQuery(self, slice_id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: slice_query
* exposed API endpoint to get querystring for a slice * Added unit tests for endpoint * fixed test case for python3 * moved get querystring logic into its own func * renamed query string endpoint
* exposed API endpoint to get querystring for a slice * Added unit tests for endpoint * fixed test case for python3 * moved get querystring logic into its own func * renamed query string endpoint
Exposes an endpoint
superset/slices/<slice_id>/query
that returns the corresponding query string and language for that slice in the form{ query: querystring, language: querylang }
, which would be seen when clicking onQuery
in the explore slice view.Also includes some unit tests.