Repository navigation
fix: reject compared_against combined with a version range in delta - #9552
Merged
Xuanwo merged 1 commit intoOct 23, 2026
Merged
Conversation
Python's `LanceDataset.delta()` and the JNI `nativeBuild` each picked one delta mode before calling `DatasetDeltaBuilder::build`, so a range set together with `compared_against` was dropped and the call returned the delta between `compared_against` and the current version. Forward every argument so `build` rejects the combination.
jackylee-ch
force-pushed
the
fix/java-deltabuilder-validation
branch
from
October 21, 2026 09:34
1a31c37 to
fca2267
Compare
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
Forwarding every supplied field lets the Rust builder enforce the documented version-selection rules in both Python and Java. This prevents conflicting arguments from silently selecting the wrong delta while keeping validation in one place.
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.
DatasetDeltaBuilder::buildrejectscompared_against_versioncombined with a begin/end range, but both bindings picked one mode before the core saw them. Python'sLanceDataset.delta()forwarded the range only whencompared_againstwasNone, and the JNInativeBuildforwarded it only whencomparedAgainstwas unset. Sods.delta(1, begin_version=3, end_version=7), or the same selection on the JavaDatasetDeltaBuilder, returned the delta between version 1 and the dataset's current version with no error, although the Python docstring promises aValueError.Both bindings now forward every argument and let
buildreject the combination.Behaviour change
Combining the two modes raises
ValueErrorin Python andIllegalArgumentExceptionin Java instead of returning a delta. In Java, setting only one end of the range still raisesIllegalArgumentException, now with the core's "Must specify both" message instead of "Must specify either".Dataset.delta(long)andDataset.delta(long, long)set a single mode and are unaffected.Tests
test_delta_validation_errorsandDeltaTestgain the conflicting case, which returned a delta before the fix;DeltaTestalso pins the half-set message. Ranpytest python/tests/test_delta.pyand./mvnw test -Dtest=DeltaTest, plusmake lint-python, spotless, and clippy with-D warningsonlance-jni.