fix: large spreadsheet upload takes minutes and stalls the server (#33770)

Uploading a big, sparsely filled .xlsx sent the document parser into a very slow table-detection step; a 28,000-row sheet took around 13 minutes, long enough for health checks to fail and pods to be restarted. Spreadsheets are now read as a whole sheet without that step, which took a 2,500-row sheet from 17.6 s to about 1 s with identical text. Sheets that hold several separate tables on one sheet now come out as one block instead of one block per table.

Fixes #33768
This commit is contained in:
Classic298 2026-11-05 13:47:16 +01:00 • committed by GitHub
parent bc14c37670
commit e9cb194f46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -785,7 +785,8 @@ class Loader:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
] or file_ext in ['xls', 'xlsx']:
try:
loader = UnstructuredLoader(file_path, 'xlsx')
# Subtable detection is very slow on large sparse sheets.
loader = UnstructuredLoader(file_path, 'xlsx', find_subtable=False)
except ImportError:
log.warning(
"The 'unstructured' package is not installed. "