Skip to content

chore: use Uuid type for Transaction.uuid instead of String#6350

Draft
wjones127 wants to merge 4 commits intolance-format:mainfrom
wjones127:wjones747/transaction-uuid-type
Draft

chore: use Uuid type for Transaction.uuid instead of String#6350
wjones127 wants to merge 4 commits intolance-format:mainfrom
wjones127:wjones747/transaction-uuid-type

Conversation

@wjones127
Copy link
Copy Markdown
Contributor

Previously, Transaction.uuid was typed as String despite always holding a UUID value. This required Uuid::new_v4().to_string() at creation, .clone() at every use site, and no type-level guarantee about the format.

Change the field to Uuid:

  • Parse from the proto string field in TryFrom<pb::Transaction> with Uuid::parse_str
  • Serialize back with .hyphenated().to_string() in From<&Transaction>
  • TransactionBuilder::uuid now accepts Uuid directly
  • DeepSizeOf is now implemented manually since uuid::Uuid doesn't implement that trait (it's fixed-size, so deep_size_of_children is 0 for that field)
  • Update call sites in lance-namespace-impls that exposed the uuid as a string via the API

Closes #6346

Previously, Transaction.uuid was stored as String, requiring
Uuid::new_v4().to_string() at creation and .clone() everywhere else.
Change it to Uuid, parsing from the proto string in TryFrom and
formatting with .hyphenated().to_string() at the proto serialization
boundary. Update TransactionBuilder::uuid to accept Uuid directly.

Closes lance-format#6346
@github-actions github-actions bot added the chore label Mar 30, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 96.49123% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rust/lance/src/dataset/transaction.rs 83.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Extract uuid as String from Python then parse to Uuid in FromPyObject,
and convert Uuid to hyphenated String in IntoPyObject.
- Drop .hyphenated() since Display for Uuid already uses hyphenated format
- In dir.rs tests, parse the API-returned string to Uuid for comparison
  rather than converting Uuid to String — this is semantically cleaner
  and removes noise from the diff
- Add uuid as dev-dependency in lance-namespace-impls for test use
@github-actions github-actions bot added the java label Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: use Uuid type for Transaction.uuid instead of String

1 participant