Show binary columns as a stub instead of reading their blobs#48
Merged
Conversation
Binary columns (e.g. raw document bytes) are often large. Materializing them into the display buffer is what made jump-to-end and scrolling stall on big datasets — reading ~GBs of blobs just to render a preview the grid truncates anyway (measured: a 64-row end slice of the EDGAR hive set was ~78 MB / 5 min cold; the same slice with the binary column projected out is ~4 s). The display buffer now replaces binary columns with a "‹binary›" stub literal, so polars never reads those column pages. The column still appears in its place (header + stub cells), and the real bytes remain available via `lf` for export and analysis (export collects from `lf`, not the display buffer). A bonus: small columns previously hidden behind a wide binary column now fit on screen. Adds a test asserting the buffer holds the stub, not binary data.
Binary columns show the ‹binary› placeholder; style those cells with a dedicated color (default dark gray) plus italic so they read as a placeholder rather than data. The color is themeable via a new binary_col config key alongside the existing column-type colors, and is applied independently of the column_colors toggle since the stub is never real data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Render binary (blob) columns in the data table as a distinct dim-italic placeholder (`‹binary›`) instead of reading their bytes into the display buffer. Reading large blobs (e.g. raw document bytes across many partitions) is what stalled scrolling and jump-to-end; the buffer now holds a stub while the real bytes remain in `lf` for export.
Includes a `binary_col` style config key and documentation.
Commits