Skip to content

refactor(table): move transaction.rs into lance-table - #8054

Draft
wjones127 wants to merge 2 commits into
refactor/transaction-prereqsfrom
refactor/transaction-to-lance-table
Draft

refactor(table): move transaction.rs into lance-table#8054
wjones127 wants to merge 2 commits into
refactor/transaction-prereqsfrom
refactor/transaction-to-lance-table

Conversation

@wjones127

Copy link
Copy Markdown
Contributor

Stacked on #8053. Review that one first; this PR targets its branch.

Building a manifest from a transaction reads and writes only table metadata. Now that #8053 has moved the helpers it depended on, transaction.rs has no dependency on Dataset, Session, DataFusion, or async I/O — restore_old_manifest is the only thing that touches storage at all, and it uses only ObjectStore and CommitHandler. So the file moves to lance-table.

The file itself is unchanged apart from import paths. lance::dataset::transaction becomes a re-export, so nothing changes at any call site — not in lance, not in the Python bindings, not in the Java bindings.

Git reports the move as a 97% rename, so the review surface is the import block rather than 6500 added and 6500 deleted lines. Keeping it that way is why the file arrives here whole and gets split into a module tree in a separate follow-up, and why the shim is an inline pub mod transaction in dataset.rs rather than a file at the old path — a file there would have left the addition with nothing to pair against, and the rename would not have been detected.

Beyond import paths, the moved file changes in three ways, all visible in the rename diff:

  • build_manifest, restore_old_manifest, modifies_same_metadata and upsert_key_conflict widen from pub(crate) to pub, because their callers in io/commit.rs and io/commit/conflict_resolver.rs are now in another crate. lance's own public API is unchanged.
  • The test module gains a default_build_config() helper, since ManifestWriteConfig stays in lance and its Default is what the 22 build_manifest test call sites used.
  • One comment that named ManifestWriteConfig::default() now describes the default config without naming a type from a higher crate.

The one test that needed Dataset moves to dataset_transactions.rs in the first commit, so the second commit is the rename alone. Test counts confirm nothing was dropped: 58 tests before, 57 in lance-table after, plus that one.

Not included

The split into a module tree — operation.rs, conflicts.rs, manifest_build.rs, proto.rs and friends — is the next PR in the stack. This PR leaves a single 6488-line file in lance-table.

Collapsing the new lance_table::transaction::Transaction with the existing lance_table::format::Transaction (a thin pb::Transaction wrapper whose doc comment says it exists so that "lance-table does not depend on higher layers" — the exact inversion this removes) would change the public CommitHandler trait signature, so it is left for later.

wjones127 and others added 2 commits July 28, 2026 13:35
…saction.rs

test_build_manifest_partial_last_updated_rewrite_columns_stable_row_ids is
the only test in transaction.rs that needs Dataset, WriteParams and Session.
The other 69 build their inputs by hand. Moving it to dataset_transactions.rs,
where the dataset-level transaction tests already live, lets transaction.rs
move to lance-table unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Building a manifest from a transaction reads and writes only table metadata.
The file has no dependency on Dataset, Session, DataFusion, or async I/O
beyond restore_old_manifest, which uses only ObjectStore and CommitHandler,
so it belongs at the table layer.

The file moves unchanged apart from import paths. lance::dataset::transaction
becomes a re-export, so no caller in lance, the Python bindings, or the Java
bindings changes.

build_manifest, restore_old_manifest, modifies_same_metadata and
upsert_key_conflict widen from pub(crate) to pub, since their callers in
io/commit.rs and io/commit/conflict_resolver.rs are now in another crate.
lance's own public API is unchanged.

The split into a module tree is deliberately left for a follow-up so this
step stays a single detected rename.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@geruh geruh 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.

The rename lgtm!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants