mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-26 12:33:59 +00:00
feat(nodejs): add Enterprise table override APIs (#5077)
Add TypeScript `getTableOverrides`, `updateTableOverrides`, and `resetTableOverrides` for LanceDB Enterprise tables, delegating to the shared Rust implementation used by Python. Document that updates perform GET → recursive local merge → full PUT. Unrelated fields are preserved from the read snapshot, but concurrent edits can be overwritten. CLI `set` and REST PUT retain replacement semantics. Fix an empty SDK update to return the current snapshot without a PUT. Live testing found that the previous implementation submitted an empty replacement and failed when no overrides were configured. The fix applies to Python, Rust, and TypeScript. Add mock HTTP/local coverage and an opt-in Enterprise integration suite for namespaces, branch isolation, REST replacement, validation failures, historical handles, and empty updates.
This commit is contained in:
@@ -4016,6 +4016,23 @@ def test_update_table_overrides_sync_remote_table_merges_existing_fields():
|
||||
assert calls == ["GET", "PUT"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("current", [{}, {"custom": {"keep": True}}])
|
||||
def test_empty_update_table_overrides_only_reads(current):
|
||||
calls = []
|
||||
|
||||
def overrides_handler(request, parsed):
|
||||
calls.append(request.command)
|
||||
assert request.command == "GET"
|
||||
assert parsed.path == "/admin/table/overrides"
|
||||
assert_table_overrides_query(parsed)
|
||||
send_json(request, current)
|
||||
|
||||
with table_overrides_test_table(overrides_handler) as table:
|
||||
assert table.update_table_overrides() == current
|
||||
|
||||
assert calls == ["GET"]
|
||||
|
||||
|
||||
def test_reset_table_overrides_sync_remote_table():
|
||||
def overrides_handler(request, parsed):
|
||||
assert request.command == "POST"
|
||||
|
||||
Reference in New Issue
Block a user