mirror of
https://github.com/apache/superset.git
synced 2026-04-21 00:54:44 +00:00
chore(dao): Replace save/overwrite with create/update respectively (#24467)
This commit is contained in:
@@ -42,11 +42,10 @@ class CreateAnnotationCommand(BaseCommand):
|
||||
def run(self) -> Model:
|
||||
self.validate()
|
||||
try:
|
||||
annotation = AnnotationDAO.create(self._properties)
|
||||
return AnnotationDAO.create(attributes=self._properties)
|
||||
except DAOCreateFailedError as ex:
|
||||
logger.exception(ex.exception)
|
||||
raise AnnotationCreateFailedError() from ex
|
||||
return annotation
|
||||
|
||||
def validate(self) -> None:
|
||||
exceptions: list[ValidationError] = []
|
||||
|
||||
@@ -39,11 +39,10 @@ class CreateAnnotationLayerCommand(BaseCommand):
|
||||
def run(self) -> Model:
|
||||
self.validate()
|
||||
try:
|
||||
annotation_layer = AnnotationLayerDAO.create(self._properties)
|
||||
return AnnotationLayerDAO.create(attributes=self._properties)
|
||||
except DAOCreateFailedError as ex:
|
||||
logger.exception(ex.exception)
|
||||
raise AnnotationLayerCreateFailedError() from ex
|
||||
return annotation_layer
|
||||
|
||||
def validate(self) -> None:
|
||||
exceptions: list[ValidationError] = []
|
||||
|
||||
Reference in New Issue
Block a user