Repository navigation
feat(core): add UUIDv7 id-generation util + Python binding - #134
Merged
Merged
Conversation
Records are keyed by caller-supplied string ids. Provide a shared time-ordered id generator so callers default to sortable keys instead of fully-random v4: `generate_id()` / `new_uuid()` in lance-context-core, re-exported at the crate root, plus a `generate_id()` pyfunction exposed as `lance_context.generate_id` in the Python package. UUIDv7 puts a 48-bit Unix-ms timestamp in the high bits, so ids sort roughly in creation order — keeping appends clustered at an index tail rather than scattering them (friendlier to Lance's on-write indexing). Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Two blank lines after generate_id() and sort the _internal imports so `generate_id` precedes `version`, per ruff. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
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.
Summary
lance_context_core::generate_id() -> Stringandnew_uuid() -> Uuid, re-exported at the crate root.generate_id()pyfunction exposed aslance_context.generate_id.Notes
v7feature on the existinguuiddep inlance-context-core.Test plan
cargo test -p lance-context-core id::tests(v7 round-trip, uniqueness, cross-ms sort order)cargo buildfor the python cratecargo fmt --all --check🤖 Generated with Claude Code