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)
  • Loading branch information
Sheng Hong Tan authored and xtinec committed Jan 22, 2019
1 parent a843715 commit 914029d
Show file tree
Hide file tree
Showing 2 changed files with 12 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 @@ -2640,6 +2640,9 @@ def fetch_datasource_metadata(self):

@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
9 changes: 9 additions & 0 deletions superset/views/lyft.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,14 @@ def sql_json(self):
return json_error_response('{}'.format(e))
return self.sql_json_call(request)

@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 914029d

Please sign in to comment.