Expand description
Table cell budgets (#861; docling-core 2.103.1’s settings.max_table_cells
and max_total_table_cells, its answer to a DoS advisory).
Every reader of a table materializes its grid — the dense rows the
serializers print, the num_rows × num_cols slot map of the JSON export —
so a table’s cost is its declared area, not its bytes: a docling-JSON
TableData can declare num_rows = num_cols = 10^6 around one cell, and
an OTSL stream (DocTags, DocLang) of one row of 10^6 tokens and 10^6
rows of one token asks for 10^12 slots from a few megabytes. docling-core
rejects both at load; so do the readers here, through one
TableCellBudget per document, with the typed LimitExceeded on the
error’s source chain (read with ConversionError::limit()), never a bare
parse error.
The rows and columns are bounded on their own too, as upstream does: a table of many rows and no columns still allocates one (empty) row each.
Structs§
- Limit
Exceeded - An input asked for more than a safety limit allows.
variablenames the environment variable that raises the limit;whatthe input part. - Table
Cell Budget - The cell budget of one document: each table is checked against the per-table cap and added to the running total, which is checked against the per-document cap. One budget per conversion, read from the environment when it is created.
Constants§
- MAX_
TABLE_ CELLS_ VAR - Cells (
rows × cols, and rows or columns alone) one table may declare; docling-core’smax_table_cells. - MAX_
TOTAL_ TABLE_ CELLS_ VAR - Cells every table of one document may declare together; docling-core’s
max_total_table_cells. Bounds a document of many tables each just under the per-table cap.
Functions§
- max_
table_ cells DOCLING_RS_MAX_TABLE_CELLS(1 000 000, upstream’s default).- max_
total_ table_ cells DOCLING_RS_MAX_TOTAL_TABLE_CELLS(5 000 000, upstream’s default).