bkyryliuk commented on a change in pull request #9923:
URL: 
https://github.com/apache/incubator-superset/pull/9923#discussion_r441882677



##########
File path: superset/views/database/views.py
##########
@@ -65,9 +65,18 @@ def certificate_form_validator(_, field: StringField) -> 
None:
 
 def upload_stream_write(form_file_field: "FileStorage", path: str):
     chunk_size = app.config["UPLOAD_CHUNK_SIZE"]
+    max_size = app.config["UPLOAD_MAX_BYTES"] or float("inf")
     with open(path, "bw") as file_description:
         while True:
             chunk = form_file_field.stream.read(chunk_size)
+            max_size -= len(chunk)

Review comment:
       please add the unit test




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to