mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
* [SIP-5] Open a new /api/v1/query endpoint that takes query_obj - Introduce a new handle_superset_exception decorator to avoid repeating the logic for catching SupersetExceptions - Create a query_obj_backfill method that takes form_data and constructs a query_obj that will be constructed in the client in the future. Use the backfill in explore_json. - Create a new /api/v1/query endpoint that takes query_obj only and returns the payload data. Note the query_obj is constructed in the client. The endpoint currently only handles query_obj for table view viz (we'll be adding support to new viz types as we go). - Unit test to verify the new endpoint for table view * fix tests and lint errors * - Move the new query endpoint into its own api.py view. - Create QueryObject and QueryContext class to encapsulate query_object to be built from the client and additional info (e.g. datasource) needed to get the data payload for a given query - Remove the query_obj_backfill as we'll start building the first query_object on the client so it no longer makes sense to have a short-lived backfill for the matter of days. * Fixing lint and test errors * Fixing additional lint error from the previous rebase. * fixing additional lint error * addressing additional pr comments * Make /query accept a list of queries in the query_context object. * fixing a lint error * - Move time_shift based calculation and since, until check into util - Add typing info for get_since_until - Add new unit tests to verify time_shift calculation and the since until check
41 lines
721 B
Python
41 lines
721 B
Python
# pylint: disable=C,R,W
|
|
|
|
|
|
class SupersetException(Exception):
|
|
status = 500
|
|
|
|
def __init__(self, msg):
|
|
super(SupersetException, self).__init__(msg)
|
|
|
|
|
|
class SupersetTimeoutException(SupersetException):
|
|
pass
|
|
|
|
|
|
class SupersetSecurityException(SupersetException):
|
|
status = 401
|
|
|
|
def __init__(self, msg, link=None):
|
|
super(SupersetSecurityException, self).__init__(msg)
|
|
self.link = link
|
|
|
|
|
|
class MetricPermException(SupersetException):
|
|
pass
|
|
|
|
|
|
class NoDataException(SupersetException):
|
|
status = 400
|
|
|
|
|
|
class NullValueException(SupersetException):
|
|
status = 400
|
|
|
|
|
|
class SupersetTemplateException(SupersetException):
|
|
pass
|
|
|
|
|
|
class SpatialException(SupersetException):
|
|
pass
|