mirror of
https://github.com/apache/superset.git
synced 2026-04-25 02:55:07 +00:00
refactor: Remove CSV upload size limit and related validation (#32000)
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import inspect
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Any, TypedDict
|
||||
|
||||
@@ -1234,16 +1233,6 @@ class CSVUploadPostSchema(BaseUploadPostSchema):
|
||||
) from ex
|
||||
return data
|
||||
|
||||
@validates("file")
|
||||
def validate_file_size(self, file: FileStorage) -> None:
|
||||
file.flush()
|
||||
size = os.fstat(file.fileno()).st_size
|
||||
if (
|
||||
current_app.config["CSV_UPLOAD_MAX_SIZE"] is not None
|
||||
and size > current_app.config["CSV_UPLOAD_MAX_SIZE"]
|
||||
):
|
||||
raise ValidationError([_("File size exceeds the maximum allowed size.")])
|
||||
|
||||
|
||||
class ExcelUploadPostSchema(BaseUploadPostSchema):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user