Repository navigation
fix(mem_wal): sync MemWAL type stubs with the binding signatures - #9701
Merged
Xuanwo merged 4 commits intoOct 23, 2026
Merged
Conversation
The stubs for the MemWAL classes had fallen behind the PyO3 signatures: - `_LsmScanner.limit` required `n`, but the binding defaults it to `None` to allow an offset-only limit. - `_LsmVectorSearchPlanner.plan_search` was missing `refine_base_table` and `overfetch_factor`. - `_LsmVectorSearchPlanner.__init__` was missing `filter`. - `_ShardWriter.lsm_scanner` accepted `None` for `shard_snapshots`, but the binding takes a list and raises `TypeError` on `None`; the empty default applies only when the argument is omitted. pyright rejected the first two in `lance/mem_wal.py`. That file was not in pyright's include list, which is why the mismatch went unnoticed; it is added now that it checks clean. The last two do not surface through `lance/mem_wal.py`, which passes `filter` via `**kwargs` and never passes `None` to `lsm_scanner`.
pyright runs before the package is built in CI, so `import lance` in mem_wal.py resolved to the native stub package `lance/lance`, which has no `LanceDataset`. Import `LanceDataset` and `LanceSchema` relatively, matching fragment.py.
Collaborator
Author
|
Hi @jackye1995 and @hamersaw mem_wal related bug fix. Would u mind to take a look? Thanks.
|
Xuanwo
approved these changes
Oct 23, 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.
Description
The type stubs for the MemWAL classes in
lance/lance/__init__.pyihad drifted from the PyO3 signatures, so pyright both rejected valid calls and accepted invalid ones._LsmScanner.limitnrequiredndefaults toNone, solimit(offset=10)is valid_LsmVectorSearchPlanner.plan_searchrefine_base_table/overfetch_factor_LsmVectorSearchPlanner.__init__filterfiltersupported_ShardWriter.lsm_scannerNoneNoneraisesTypeErrorat runtimelance/mem_wal.pyis also added to pyright'sincludelist, so future drift in the first two kinds is caught in CI. The last two are not visible through that file: it passesfiltervia**kwargsand never passesNonetolsm_scanner.No runtime behavior changes.