Skip to content

fix: validate write mode in write_lance#5191

Open
LuciferYang wants to merge 1 commit into
lance-format:mainfrom
LuciferYang:fix/validate-write-mode
Open

fix: validate write mode in write_lance#5191
LuciferYang wants to merge 1 commit into
lance-format:mainfrom
LuciferYang:fix/validate-write-mode

Conversation

@LuciferYang

Copy link
Copy Markdown

write_lance never checked that mode was one of create, append, or overwrite. A typo like mode="upsert" slipped straight through and silently did nothing useful: on the non-stream path the commit op was left as None, so fragments were written but never committed, and the streaming path quietly fell back to overwrite.

_validate_write_args now rejects any unknown mode up front with a ValueError listing the valid options. It runs before the stream/non-stream split, so both paths are covered, and valid modes are unaffected.

An out-of-contract mode previously fell through to a silent no-op: the
non-stream path left the commit op as None (fragments written, never
committed) and the streaming path silently overwrote. Reject any mode
outside {create, append, overwrite} up front.
@github-actions github-actions Bot added the bug Something isn't working label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant