Skip to content

Commit

Permalink
expose queries endpoint
Browse files Browse the repository at this point in the history
(cherry picked from commit d23bfa0)

(cherry picked from commit 7fdd3e8)
(cherry picked from commit 914029d)
(cherry picked from commit 0c35cd9)
  • Loading branch information
Sheng Hong Tan authored and xtinec committed Feb 5, 2019
1 parent 3a69754 commit fe6ea59
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 @@ -2657,6 +2657,9 @@ def fetch_datasource_metadata(self):
@has_access_api
@expose('/queries/<last_updated_ms>')
def queries(self, last_updated_ms):
return self.queries_call(last_updated_ms)

def queries_call(self, last_updated_ms):
"""Get the updated queries."""
stats_logger.incr('queries')
if not g.user.get_id():
Expand Down
10 changes: 10 additions & 0 deletions superset/views/lyft.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,15 @@ def sql_json(self):
return json_error_response('{}'.format(e))
return self.sql_json_call(request)

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


appbuilder.add_view_no_menu(Lyft)

0 comments on commit fe6ea59

Please sign in to comment.