Skip to content

Commit

Permalink
csv: remove file size limit
Browse files Browse the repository at this point in the history
* the new extension can handle very large files.
  • Loading branch information
ntarocco committed Sep 14, 2023
1 parent 71d6d49 commit 2604c18
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions invenio_previewer/extensions/csv_papaparsejs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,9 @@
previewable_extensions = ["csv", "dsv"]


def validate_csv(file):
"""Return dialect information about given csv file."""
max_file_size = current_app.config.get(
"PREVIEWER_MAX_FILE_SIZE_BYTES", 10 * 1024 * 1024
)
is_size_valid = file.size <= max_file_size
return is_size_valid


def can_preview(file):
"""Determine if the given file can be previewed."""
return (
file.is_local() and file.has_extensions(".csv", ".dsv") and validate_csv(file)
)
return file.is_local() and file.has_extensions(".csv", ".dsv")


def preview(file):
Expand Down

0 comments on commit 2604c18

Please sign in to comment.