You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: expose branch_identifier in python and java bindings (#6360)
### Motivation
- Surface the full branch lineage (version -> uuid mapping) from Rust
`BranchIdentifier` into higher-level bindings so clients can inspect a
branch's lineage chain.
### Description
- Update the JNI layer (`java/lance-jni/src/blocking_dataset.rs`) to
construct and pass a `List<BranchVersionMapping>` when creating the Java
`Branch` object.
- Extend the Java model (`java/src/main/java/org/lance/Branch.java`)
with an inner `BranchVersionMapping` class, add a `branchIdentifier`
field and getter, update constructor/signature, and include it in
`toString`, `equals`, and `hashCode`.
- Update Java tests (`java/src/test/java/org/lance/DatasetTest.java`) to
assert the presence and contents of `branchIdentifier` for created
branches.
- Add `branch_identifier: List[Tuple[int, str]]` to the Python `Branch`
`TypedDict` (`python/python/lance/dataset.py`) and update the Python
Rust bridge (`python/src/dataset.rs`) to include
`meta.identifier.version_mapping` in the returned branch dictionaries.
- Update Python tests (`python/python/tests/test_dataset.py`) to
validate the `branch_identifier` contents in `branches.list()`
responses.
### Testing
- Ran the modified Java unit test `DatasetTest::test_branches` which
exercises branch creation, listing and metadata assertions, and it
passed.
- Ran the modified Python test `test_branches` with `pytest` which
verifies `branch_identifier` in `branches.list()` and it passed.
- Exercised JNI/bridge code paths while running the above tests to
validate interop and serialization of the version->uuid mappings, and no
failures were observed.
0 commit comments