Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: changed disabled rules in datasets module #10979

Merged
merged 2 commits into from
Sep 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions superset/datasets/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,7 @@ def post(self) -> Response:
@protect()
@safe
@statsd_metrics
def put( # pylint: disable=too-many-return-statements, arguments-differ
self, pk: int
) -> Response:
def put(self, pk: int) -> Response:
"""Changes a Dataset
---
put:
Expand Down Expand Up @@ -270,24 +268,25 @@ def put( # pylint: disable=too-many-return-statements, arguments-differ
return self.response_400(message=error.messages)
try:
changed_model = UpdateDatasetCommand(g.user, pk, item).run()
return self.response(200, id=changed_model.id, result=item)
response = self.response(200, id=changed_model.id, result=item)
except DatasetNotFoundError:
return self.response_404()
response = self.response_404()
except DatasetForbiddenError:
return self.response_403()
response = self.response_403()
except DatasetInvalidError as ex:
return self.response_422(message=ex.normalized_messages())
response = self.response_422(message=ex.normalized_messages())
except DatasetUpdateFailedError as ex:
logger.error(
"Error updating model %s: %s", self.__class__.__name__, str(ex)
)
return self.response_422(message=str(ex))
response = self.response_422(message=str(ex))
return response

@expose("/<pk>", methods=["DELETE"])
@protect()
@safe
@statsd_metrics
def delete(self, pk: int) -> Response: # pylint: disable=arguments-differ
def delete(self, pk: int) -> Response:
"""Deletes a Dataset
---
delete:
Expand Down