Skip to content

feat(cleanup): support cleaning specific dataset versions - #8617

Open
hfutatzhanghb wants to merge 2 commits into
lance-format:mainfrom
hfutatzhanghb:codex/cleanup-specific-version
Open

feat(cleanup): support cleaning specific dataset versions#8617
hfutatzhanghb wants to merge 2 commits into
lance-format:mainfrom
hfutatzhanghb:codex/cleanup-specific-version

Conversation

@hfutatzhanghb

Copy link
Copy Markdown
Contributor

Summary

Add an exact-version cleanup policy to CleanupPolicy so users can remove only specified intermediate dataset versions.

dataset.cleanup_old_versions(versions=[2])

Rust and Java policy builders expose the same versions filter. The filter combines with existing cleanup filters; current and tagged versions remain protected by the existing cleanup rules.

Closes #8616.

Changes

  • Rust: add CleanupPolicy::versions and CleanupPolicyBuilder::versions.
  • Python: add versions to cleanup_old_versions and explain_cleanup_old_versions.
  • Java: add CleanupPolicy.withVersions(List<Long>) and JNI extraction.
  • Tests added for exact intermediate-version cleanup in Rust, Python, and Java.

Verification

cargo check -p lance --tests, cargo check --manifest-path python/Cargo.toml, and cargo check --manifest-path java/lance-jni/Cargo.toml passed locally before local Cargo verification was disabled. Targeted tests were added but not run locally.

Add exact-version cleanup policy across Rust, Python, and Java.

Closes lance-format#8616
@github-actions github-actions Bot added A-python Python bindings A-java Java bindings + JNI enhancement New feature or request labels Aug 18, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gate recommendation: approve.

The exact-version selector is applied as a narrowing predicate inside the existing cleanup engine, preserving current-version, tag, shared-file, branch-lineage, and concurrent-cleanup protections across Rust, Python, and Java.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Aug 18, 2026
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-java Java bindings + JNI A-python Python bindings enhancement New feature or request K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support cleaning a specific dataset version

1 participant