mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore(pylint): Reenable raise-missing-from check (#16266)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
This commit is contained in:
@@ -44,7 +44,7 @@ class BulkDeleteAnnotationCommand(BaseCommand):
|
||||
return None
|
||||
except DAODeleteFailedError as ex:
|
||||
logger.exception(ex.exception)
|
||||
raise AnnotationBulkDeleteFailedError()
|
||||
raise AnnotationBulkDeleteFailedError() from ex
|
||||
|
||||
def validate(self) -> None:
|
||||
# Validate/populate model exists
|
||||
|
||||
@@ -48,7 +48,7 @@ class CreateAnnotationCommand(BaseCommand):
|
||||
annotation = AnnotationDAO.create(self._properties)
|
||||
except DAOCreateFailedError as ex:
|
||||
logger.exception(ex.exception)
|
||||
raise AnnotationCreateFailedError()
|
||||
raise AnnotationCreateFailedError() from ex
|
||||
return annotation
|
||||
|
||||
def validate(self) -> None:
|
||||
|
||||
@@ -44,7 +44,7 @@ class DeleteAnnotationCommand(BaseCommand):
|
||||
annotation = AnnotationDAO.delete(self._model)
|
||||
except DAODeleteFailedError as ex:
|
||||
logger.exception(ex.exception)
|
||||
raise AnnotationDeleteFailedError()
|
||||
raise AnnotationDeleteFailedError() from ex
|
||||
return annotation
|
||||
|
||||
def validate(self) -> None:
|
||||
|
||||
@@ -52,7 +52,7 @@ class UpdateAnnotationCommand(BaseCommand):
|
||||
annotation = AnnotationDAO.update(self._model, self._properties)
|
||||
except DAOUpdateFailedError as ex:
|
||||
logger.exception(ex.exception)
|
||||
raise AnnotationUpdateFailedError()
|
||||
raise AnnotationUpdateFailedError() from ex
|
||||
return annotation
|
||||
|
||||
def validate(self) -> None:
|
||||
|
||||
@@ -39,10 +39,10 @@ class AnnotationDAO(BaseDAO):
|
||||
)
|
||||
if commit:
|
||||
db.session.commit()
|
||||
except SQLAlchemyError:
|
||||
except SQLAlchemyError as ex:
|
||||
if commit:
|
||||
db.session.rollback()
|
||||
raise DAODeleteFailedError()
|
||||
raise DAODeleteFailedError() from ex
|
||||
|
||||
@staticmethod
|
||||
def validate_update_uniqueness(
|
||||
|
||||
@@ -51,8 +51,8 @@ annotation_json_metadata = "JSON metadata"
|
||||
def validate_json(value: Union[bytes, bytearray, str]) -> None:
|
||||
try:
|
||||
utils.validate_json(value)
|
||||
except SupersetException:
|
||||
raise ValidationError("JSON not valid")
|
||||
except SupersetException as ex:
|
||||
raise ValidationError("JSON not valid") from ex
|
||||
|
||||
|
||||
class AnnotationPostSchema(Schema):
|
||||
|
||||
Reference in New Issue
Block a user