feat: wire batch_size_bytes to Python and public Rust API#6428
Merged
westonpace merged 6 commits intolance-format:mainfrom Apr 10, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
The encoding layer already supports byte-based batching via SchedulerDecoderConfig.batch_size_bytes but all callers hardcoded it to None. This wires the parameter through FileReaderOptions, Scanner, LanceScanConfig, and the Python bindings so users can specify it when scanning a dataset. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f94ed45 to
9024fa5
Compare
Instead of threading batch_size_bytes individually through LanceScanConfig and FilteredReadOptions, pass the full FileReaderOptions bundle so future options flow through automatically. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… levels Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The parameter was added to the function but missing from the #[pyo3(signature=...)] attribute, causing a positional argument mismatch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ReadParams and Scanner are not in scope from lance-file, so use plain backtick references instead of rustdoc links. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
BubbleCal
reviewed
Apr 10, 2026
| .or_else(|| self.dataset.file_reader_options.clone()); | ||
| match (base, self.batch_size_bytes) { | ||
| (Some(mut opts), Some(bsb)) => { | ||
| if opts.batch_size_bytes.is_none() { |
Contributor
There was a problem hiding this comment.
should we always set opts.batch_size_bytes = Some(bsb) no matter whether opts.batch_size_bytes is None or not?
Member
Author
There was a problem hiding this comment.
If we set opts.batch_size_bytes then we will override batch_size.
I don't want to change the default (yet) so that this can stay a non-breaking change. The default is that the user doesn't set batch_size_bytes on either the scanner settings or the dataset settings and so we use batch_size instead.
BubbleCal
approved these changes
Apr 10, 2026
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.
Summary
Stacked on #6388. Please merge that PR first.
batch_size_bytes: Option<u64>toFileReaderOptionsand propagates it through all 6SchedulerDecoderConfigcreation sites in the file readerbatch_size_bytesfield + setter toScanner, wired through bothscan_fragments(viaLanceScanConfig) andpushdown_scan(viaFileReaderOptionsinScanConfig)batch_size_bytestoLanceScanConfig, withtry_new_v2injecting it intoFragReadConfigviaFileReaderOptionsbatch_size_bytesin the Python API:LanceDataset.scanner(),to_table(),to_batches(),ScannerBuilderTest plan
cargo check -p lance-file -p lance --tests— cleancargo clippy -p lance-file -p lance --tests -- -D warnings— cleancargo fmt --all— appliedcargo test -p lance-encoding -- byte_sized— 3/3 passcargo test -p lance -- test_scan— 38/38 pass🤖 Generated with Claude Code