rusackas commented on code in PR #40860:
URL: https://github.com/apache/superset/pull/40860#discussion_r3407721757
##########
superset/databases/api.py:
##########
@@ -1727,6 +1727,7 @@ def upload_metadata(self) -> Response:
parameters = UploadFileMetadataPostSchema().load(request_form)
except ValidationError as error:
return self.response_400(message=error.messages)
+ UploadCommand.validate_file_size(parameters["file"])
Review Comment:
Good point, the 413 was undocumented. Added it to both `upload` and
`upload_metadata` in ba0f37ad4b.
##########
superset/commands/database/exceptions.py:
##########
@@ -118,6 +118,11 @@ class DatabaseUploadFailed(CommandException):
message = _("Database upload file failed")
+class DatabaseUploadFileTooLarge(CommandException):
+ status = 413
+ message = _("Database upload file exceeds the maximum allowed size.")
Review Comment:
These string catalogs are extracted with empty `msgstr` by design, the same
as every other locale until translators fill them in, so gettext just falls
back to English. Editing it here would get overwritten on the next extraction.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]