feat: add remote branch diff and merge client APIs#3686
Conversation
Wire POST /branches/diff and /branches/merge for Rust remote + Python. Parse 409 bodies as rejected results, tolerate unknown blocker/status codes, and keep MergePreview forward-compatible when fields are missing. Co-authored-by: Cursor <[email protected]>
|
@claude review |
dantasse
left a comment
There was a problem hiding this comment.
Cool, mostly looks good. Can you add this to Typescript too?
| ---------- | ||
| from_branch: str | ||
| Branch to merge from. | ||
| dry_run: bool, default True |
There was a problem hiding this comment.
what do you think about default False? (and probably updating this on the REST call too)
I get avoiding writing data unless you're very careful but after playing around with this, it feels weird (to me and the agent, or maybe I should say, to me watching the agent) that merge() without extra flags doesn't actually merge.
There was a problem hiding this comment.
+1 for dry run should be an explicit argument to turn on
jackye1995
left a comment
There was a problem hiding this comment.
looks good to me! pending docs CI fix
|
Docs PR opened: lancedb/docs#315 Documented the new Enterprise branch diff and merge APIs on the Branches page with Python and TypeScript examples. |
This PR adds some support for
diff/mergein the remote client as for local tables we stayNotSupporteduntil lance-format/lance#7263.This wires the two review-and-land calls against the remote REST API:
POST /v1/table/{id}/branches/diffPOST /v1/table/{id}/branches/mergeRust gets typed results (
BranchDiff,MergeBranchResult). Python returns the wire JSON, same shape as the REST response.Merge here means promoting a branch's added columns onto
main.Behavior
NotSupported.Ok/ a dict withstatus="rejected"and blockers indiff.mergeBlockers.Unknownso a newer server does not break older clients.MergePreviewtolerates missing fields for the same reason.Example
Testing
cargo test -p lancedb --features remote diff_branch
cargo test -p lancedb --features remote merge_branch