feat: initial work to make v1 API compatible with SIP-40 and SIP-41 (#13960)

* WIP

* Use errorhandler

* Add response schema

* Fix status on HTTPException

* s/found/encountered/g

* Fix test

* Fix lint

* Fix lint and test
This commit is contained in:
Beto Dealmeida
2021-04-06 22:06:32 -07:00
committed by GitHub
parent 1638e6e932
commit a82d72fef6
10 changed files with 282 additions and 26 deletions

View File

@@ -54,6 +54,14 @@ class SupersetErrorException(SupersetException):
)
class SupersetErrorsException(SupersetException):
"""Exceptions with multiple SupersetErrorType associated with them"""
def __init__(self, errors: List[SupersetError]) -> None:
super().__init__(str(errors))
self.errors = errors
class SupersetTimeoutException(SupersetErrorException):
status = 408
@@ -97,13 +105,9 @@ class SupersetSecurityException(SupersetException):
self.payload = payload
class SupersetVizException(SupersetException):
class SupersetVizException(SupersetErrorsException):
status = 400
def __init__(self, errors: List[SupersetError]) -> None:
super().__init__(str(errors))
self.errors = errors
class NoDataException(SupersetException):
status = 400