Skip to content

Commit

Permalink
expose results
Browse files Browse the repository at this point in the history
(cherry picked from commit 8464ffc)
(cherry picked from commit 4f58845)
(cherry picked from commit d697ae9)
  • Loading branch information
jordanpatton authored and xtinec committed Feb 5, 2019
1 parent fe6ea59 commit 7bd6b48
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2407,6 +2407,9 @@ def cache_key_exist(self, key):
@expose('/results/<key>/')
@log_this
def results(self, key):
return self.results_call(key)

def results_call(self, key):
"""Serves a key off of the results backend"""
if not results_backend:
return json_error_response("Results backend isn't configured")
Expand Down
10 changes: 10 additions & 0 deletions superset/views/lyft.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,15 @@ def queries(self, last_updated_ms):
return json_error_response('{}'.format(e))
return self.queries_call(last_updated_ms)

@has_access_api
@expose('/results/<key>')
@log_this
def results(self, key):
try:
self.authorize()
except (UserDontExistException, SupersetException) as e:
return json_error_response('{}'.format(e))
return self.results_call(key)


appbuilder.add_view_no_menu(Lyft)

0 comments on commit 7bd6b48

Please sign in to comment.