Skip to content

feat: add table branch error codes across spec, python, and java#352

Merged
brendanclement merged 2 commits into
lance-format:mainfrom
brendanclement:feat/branch-error-codes
Jun 11, 2026
Merged

feat: add table branch error codes across spec, python, and java#352
brendanclement merged 2 commits into
lance-format:mainfrom
brendanclement:feat/branch-error-codes

Conversation

@brendanclement

Copy link
Copy Markdown
Collaborator

Description

The Rust implementation in lance-format/lance defines TableBranchNotFound (22) and TableBranchAlreadyExists (23), but the spec registry and the Python and Java interface modules stop at 21. Clients converting errors by code (for example pylance via lance_namespace.errors.from_error_code) currently reclassify branch failures as InternalError, so deleting a missing branch surfaces as an internal error instead of a branch-not-found error.

This adds the two branch error codes everywhere the registry lives:

  • spec.yaml: error code registry gains 22 and 23, plus 21 (Throttling), which was already present in every implementation but missing from the spec list.
  • Python: ErrorCode members, TableBranchNotFoundError / TableBranchAlreadyExistsError, from_error_code mapping, and package re-exports.
  • Java (core and core-async): ErrorCode entries, ErrorFactory cases, and the two exception classes in each module, mirroring the existing tag exceptions.

Testing

Python round-trip test for both codes (from_error_code returns the typed exceptions with the right code values).

Surfaced by review feedback on lance-format/lance#7219, where the new Python branch API bindings expose the gap.

@github-actions github-actions Bot added the rust Rust features label Jun 11, 2026
@brendanclement brendanclement merged commit 1415436 into lance-format:main Jun 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request java Java features python Python features rust Rust features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants