Repository navigation
fix(python): expose optimize compaction options - #3870
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
# Conflicts: # python/python/lancedb/__init__.py
|
Addressed in 2a85c0e. Added Ran the documented command with temporary output and checked its shell syntax. The regenerated storage snippet module exactly matches the checked-in module, including the Rust compaction tuning tab. |
|
Blocked: The verified remote head is I inspected the check, job logs, test fixture, and repair diff. The identical test passes in NodeJS 26 on exact main, Please have a maintainer rerun the failed NodeJS 26 job. If it recurs, stabilize the upstream approximate-recall test or index-training fixture on main while preserving its effort and probe-precedence assertions; I can then integrate that correction. |
|
Blocked: The verified remote head is
I inspected both live checks and job logs and compared the failing paths with exact main, Main is already included in this head. The evidence points to intermittent failures and does not justify a speculative repair change. No merge, source change, commit, or push was made. Please have a maintainer rerun both failed jobs. If either recurs, land a focused correction on main for the approximate-recall fixture or fork/runtime behavior, preserving the assertions; I can then integrate that correction and validate this branch. |
Retain both retrain and compaction_options on RemoteTable.optimize, preserving upstream signature alignment and the existing compaction API. Validation: rebuilt the Python extension; 66 signature and optimize tests plus the Python tuning example pass. Python lint and Python/Rust formatting checks pass. Root Ruff retains 49 inherited documentation diagnostics in files identical to main.
|
Blocked: Rust / The verified remote head is
Bans, licenses, and sources pass. I inspected the job logs, compared all Cargo manifests, Cargo.lock, deny.toml, and workflows with current main Please land a dependency migration on main that allows the patched zstd family; I can then integrate and validate it. Alternatively, explicitly authorize that separate dependency migration on this repair branch. |
|
Addressed in bcf49ab. Added the Python, TypeScript, and Rust Blob v2 directories to the documented snippet-regeneration command and source list. The old command omitted 21 multimodal exports. The updated command exactly reproduces the checked-in multimodal, Blob/pylance, and compaction snippet modules; shell syntax validation also passes. |
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The documentation follow-up is verified: the updated regeneration command exactly reproduces the checked-in multimodal, Blob/pylance, and compaction snippet modules. The earlier source-list suggestion is addressed.
The compaction implementation and dependencies are unchanged, so the prior focused signature, optimization, and storage-example verification remains applicable. Remote optimization remains unsupported.
Lowering the fragment row target remains a useful steady-state mitigation for repeated wide-row rewrites, not a hard byte-based memory cap. Existing oversized fragments are rewritten whole on the first pass; source budgets admit whole tasks and can produce no work when the first task exceeds the budget; max_bytes_per_file limits output file size rather than compaction memory.
The Python/Rust tuning examples correctly remain unpublished drafts pending confirmed release availability, with the TypeScript limitation documented.
Xuanwo
left a comment
There was a problem hiding this comment.
The final documentation follow-up matches the reviewed fix and leaves the compaction implementation unchanged. The native build and applicable CI pass, and generated exports are complete. Gatekeeper recommends approval; no blocking findings remain.
Summary
Root cause
The native Python optimize binding always constructed default compaction settings, and the public AsyncTable API offered no way to lower the fragment row target. Wide-row fragments therefore remained compaction candidates on every later optimize call, repeatedly rewriting the accumulated table.
Limitations
This is an explicit row-based mitigation, not byte-native task sizing or a hard memory cap. Callers must derive target_rows_per_fragment from expected row size. Existing oversized fragments are rewritten whole on the first pass; max_bytes_per_file limits output file size rather than compaction memory; and source budgets admit whole planned tasks, so a budget below the first task performs no compaction. Splitting tasks by a byte budget or returning a planner error requires a Lance-side change.
Validation
Fixes #2325