Commit Graph
843 Commits
Author SHA1 Message Date
Tomwang.ethandXuanwo 7efeb06bc5 fix(node): reject non-integer values for integer-only numeric options (#4916)
## Problem
Several Node APIs accept integer-only options but pass JavaScript
numbers straight to integer N-API parameters. Fractional values are
silently truncated, so `checkout(1.5)` checks out version 1,
`tags.create("v1", 1.5)` pins version 1, `limit(2.5)` returns two rows,
and bucket `numBuckets: 2.5` enables two buckets instead of rejecting
the input. Negative or out-of-range values also reach Rust after lossy
conversion.

## Change
- The native `Tags` export is kept: code registering `Tags` as a `new ()
=> Tags` constructor still compiles. Validation for tag versions happens
in `Tags.prototype.create`/`update` wrappers, and #5145's
`tags.create(name)` and `tags.create(name, null)` behavior (tag the
handle's visible version) is preserved and tested.
- `checkout(version)` validates numeric versions as non-negative
integers before conversion.
- `numBuckets` is checked only for the `bucket` write spec and must be
an integer in 1–1024 before native conversion; `identity` and
`unsharded` specs ignore it.
- `limit` on plain and vector queries is checked against the native
`u32` range (0–4294967295) before conversion, covering the upper
boundary; `limit(0)` still returns no rows from plain queries.
- `nprobes`, `minimumNprobes`, `maximumNprobes`, `ef` and `refineFactor`
reject non-integers via the existing `validateNonNegativeInteger`.
Fractional `searchEffort` stays valid and is covered by a positive
regression assertion. Branch APIs are outside this patch.

This does not change the separate `TagContents` serialization fix in
#4915, and is based directly on main rather than stacked on it. This is
not a complete audit of numeric options.

## Validation
- New regression tests: fractional checkout version; non-integer tag
create/update versions plus `create(name)`/`create(name, null)`
preserved; non-integer query options with `searchEffort` positive case;
`limit` u32 upper boundary accepted, one-past rejected, `limit(0)`
returning no rows; `numBuckets` fractional/0/1025 rejected for `bucket`
and ignored by `identity`/`unsharded`.
- All pass locally on Linux x86_64 against a native build from main;
`tsc -b` and Biome checks pass. TypeScript-only change; Rust and Python
sources unchanged.

---------

Co-authored-by: Xuanwo <github@xuanwo.io>
2026-12-01 10:24:46 +08:00
c105797249 fix(node): contain rejected table write progress callbacks (#5274)
Fixes #5273

## Summary

Handle promises returned from `Table.add(..., { progress })` through the
existing callback warning path. The callback stays unawaited and the
write does not depend on its result. The patch covers write progress in
the native append path, which is separate from `Job.wait` progress.

## Validation

- The real native append regression resolves the write, reads its newly
committed rows, and then rejects the final progress callback. All seven
Apache Arrow variant cases fail on main because the warning is missing.
- With the patch, 28 append, overwrite, and progress tests pass with the
matching native beta binding.
- An actual Node run with `--unhandled-rejections=strict` exits on the
observer error on main. The patch logs the warning and reads three
expected rows.
- Biome checks on changed files and `git diff --check` pass.

---------

Co-authored-by: Divyam Talwar <237515611+DivyamTalwar@users.noreply.github.com>
Co-authored-by: Divyam Talwar <DivyamTalwar@users.noreply.github.com>
2026-11-30 21:46:22 +08:00
c90382e9c4 fix(node): handle rejected job progress callbacks (#5272)
Fixes #5271

## Summary

A promise returned from a job progress callback could reject outside the
SDK's synchronous error handler. This calls the observer synchronously
as before and attaches a rejection handler without awaiting it.

## Validation

- The regression test holds the observer promise open until `Job.wait`
completes, then rejects it and verifies the warning.
- All 4 tests in `nodejs/__test__/job.test.ts` pass using the native job
boundary stub and the published matching beta native declarations.
- A separate actual Node run with `--unhandled-rejections=strict` exits
at the observer error on main. It logs the error and continues with the
patch.
- Biome lint and format checks passed on the two changed files. `git
diff --check` passed.

---------

Co-authored-by: Divyam Talwar <237515611+DivyamTalwar@users.noreply.github.com>
Co-authored-by: Divyam Talwar <DivyamTalwar@users.noreply.github.com>
2026-11-30 21:46:02 +08:00
80c889cd9e docs: explain merge insert execution costs (#4501)
resolves #4258

## Summary

- document how indexed partial-column merges patch columns across
touched fragments
- explain how full-scan merges rewrite rows and can materialize the
target table
- describe the index-coverage, batching, and memory tradeoffs
- align the Python, Rust, and TypeScript `use_index` API documentation

## Verification

- `git diff --check`
- Ruff 0.15.20 formatting check for `python/python/lancedb/merge.py`
- Biome 1.9.4 check for `nodejs/lancedb/merge.ts`
- reviewed the rendered MDX structure and cross-SDK wording

The TypeDoc generation command was also attempted. It cannot complete in
this checkout because the Rust-generated `nodejs/lancedb/native.d.ts`
artifact is absent and Rust tooling is not installed; TypeDoc stops on
the resulting pre-existing module-resolution errors before generating
output.

---------

Signed-off-by: Himanshu S <me.mrhimanshu@gmail.com>
Co-authored-by: Himanshu <18554133+mrhimanshu@users.noreply.github.com>
Co-authored-by: Himanshu S <me.mrhimanshu@gmail.com>
2026-11-30 21:23:27 +08:00
lancedb-gatefixer[bot] d9db83de65 fix!: guard remote index routes against dot segments (#5013)
BREAKING CHANGE: Older Enterprise index listings that require per-index
statistics now omit historical entries with empty names, `.` or `..`.
Remote index operations reject these unaddressable names. Operators
needing to remove such entries can use server-side maintenance; direct
native access also supports cleanup. Ordinary index names and
`exist_ok=True` reuse require no migration.

Fixes #5007

Remote index URLs previously allowed `.` and `..` as path segments.
Reqwest normalizes them, so dropping an index named `..` could send the
table-level drop request and delete the table.

Guard the remote statistics, prewarm, and drop routes against empty
names, `.` and `..`, then percent-encode all other names. Index creation
retains its existing name policy on both backends, including names such
as `Customer lookup` and `café_idx` and reuse through `exist_ok=True`.
The same remote guard applies on checked-out branches.

Enriched Enterprise listings retain these entries without issuing stats
requests. Native cleanup is covered by a regression test. API
documentation explains these limits, and website release guidance
remains a non-rendering draft.

Validation:

- Before the review fix, 12 of 15 focused regressions failed,
reproducing valid-name rejection, generated-name reuse failure, and
mixed legacy-list failure.
- 60 focused Rust tests passed, covering unsafe routes, encoded names,
mixed legacy/enriched listings, generated names, native and Enterprise
lifecycles, checked-out branches, and `exist_ok` preservation of index
identity, definition, and table version.
- Rebuilt the Python extension in the uv-managed environment from
`python/uv.lock`; all 28 targeted Python tests passed, including both
names and synchronous/asynchronous `exist_ok` reuse.
- Node native build, TypeScript type checking, lint/format checks, four
targeted index tests, and generated API documentation passed.
- Rust formatting, Clippy (`remote`, tests and examples), Python
formatting/lint, repository-wide Typos 1.26.0, and `git diff --check`
passed. Native builds used the repository `ci` profile with
`remote,lancedb/metrics-otel` enabled for Python and Node.
- Repository-root Ruff lint reports 59 existing errors in unchanged
`docs/web-tests`; Python-package lint passes.

<!-- lance-gatekeeper-fix:v1 agent=1ef05de7bc00306ccd6f8a60b9a81003
generation=1 -->

<!-- gatefixer-walkthrough:v1
head=6b25e10810ea1d11a4ef56be63c4ef50225f65d6 -->
## Change walkthrough

```mermaid
flowchart TD
    entry["Listed index"] --> typed{"Type available?"}
    typed -->|Yes| include["Include index"]
    typed -->|No| safe{"Addressable name?"}
    safe -->|No| omit["Omit entry"]
    safe -->|Yes| stats["Encode and fetch stats"]
    stats --> include
```

Creation preserves existing name support; remote routes reject only
empty names, `.` and `..`.

**Read:** [Route
guard](https://github.com/lancedb/lancedb/blob/6b25e10810ea1d11a4ef56be63c4ef50225f65d6/rust/lancedb/src/remote/table.rs#L102-L112)
→ [Listing
fallback](https://github.com/lancedb/lancedb/blob/6b25e10810ea1d11a4ef56be63c4ef50225f65d6/rust/lancedb/src/remote/table.rs#L2534-L2596)
→ [Index-preservation
regression](https://github.com/lancedb/lancedb/blob/6b25e10810ea1d11a4ef56be63c4ef50225f65d6/rust/lancedb/src/table/create_index.rs#L1431-L1481).

<sub>Snapshot:
[6b25e10](https://github.com/lancedb/lancedb/commit/6b25e10810ea1d11a4ef56be63c4ef50225f65d6)</sub>
<!-- gatefixer-walkthrough:end -->

---------

Co-authored-by: Gatefixer <313497061+lancedb-gatefixer[bot]@users.noreply.github.com>
2026-11-30 20:51:19 +08:00
Ayanna Bansal 14e49a6710 fix(node): infer a timestamp type for Date values (#5232)
`createTable` and `makeArrowTable` reject a JavaScript `Date` when no
schema is given:

```ts
await db.createTable("events", [{ id: 1, created: new Date() }]);
// Error: Failed to infer data type for field created at row 0. Consider providing an explicit schema.
```

Row validation already lets `Date` through as a supported value, and the
same rows work with an explicit `Timestamp` schema, but `inferType` has
no branch for it, so inference gives up.

This change:

- infers `Timestamp<MILLISECOND>` for a `Date`, which is also what
Apache Arrow's own `vectorFromArray` infers and matches the precision of
a JS `Date`. A list of dates is inferred as a list even when the column
name looks like a vector column;
- writes `Timestamp(ms)` columns, and lists of them at any depth, as
signed 64-bit values in `makeVector`. `apache-arrow@15.0.0` rounds the
high 32 bits of a negative timestamp toward zero, so `new Date(-1)` came
back as 4294967295. This already affected an explicit `Timestamp(ms)`
schema on Arrow 15; inference would have made it easier to hit. `Date`,
integer and bigint values take the new path; anything else (fractional
numbers, strings, list values that are not arrays or typed arrays) is
left to Arrow exactly as before;
- rejects an Invalid Date with a clear error. Arrow 15 stored it as
1970-01-01 and newer versions threw a BigInt conversion error;
- documents the new rule in the `makeArrowTable` docstring and the
generated API page.

Not changed (explicit schemas only, behaviour as before this PR):
timestamp units other than milliseconds, timestamps inside a
`List<Struct>`, `FixedSizeList` or `Map`, and `Date` query parameters in
`sql.ts`. On Arrow 15 these still go through Arrow's conversion. I can
follow up on them separately if wanted.

Tested:
- New tests in `__test__/arrow.test.ts`: the type is inferred; values
and nulls round-trip; a `Date` mixed with a string is still rejected;
dates before 1970 survive IPC as scalars, in lists, nested lists and
structs, with and without a schema; epoch numbers, bigints and typed
arrays keep working in explicit timestamp columns; Invalid Date is
rejected in every shape.
- `jest __test__/arrow.test.ts` passes with `apache-arrow` resolved to
15.0.0, 16.0.0, 17.0.0 and 21.2.0 (swapped the way the `arrow-compat` CI
job does). On 15.0.0 the pre-1970 tests fail without the workaround. CI
does not run Arrow 15, so on newer versions the Invalid Date test is
what fails if a shape stops reaching the new writer.
- `jest __test__/table.test.ts`, `biome ci .`, `tsc -b` and `pnpm run
docs` pass.
- Checked by hand that `createTable` then `add` with `Date` values
stores and returns them.

I ran the TypeScript tests against the published 0.42.0-beta.34 native
binary; I did not rebuild the Rust side, which this change does not
touch.
2026-11-30 20:38:59 +08:00
wangshun 04bf27af9d feat: support IN subqueries in Embedded search filters (#5223)
Fixes #5222

## Summary

Embedded vector and full-text searches rejected `IN (SELECT ...)`
because Lance's scanner parsed the filter as a single-table expression.
A team-scoped search with `limit(1)` needs to rank eligible documents
using keys from the sharing table.

Resolve unqualified lookup tables through the originating database and
use DataFusion to evaluate the predicate on the search snapshot. Pass
the matching row IDs to Lance before ranking. The syntax applies to
base-table prefilters within one namespace. Literal filters use the
existing scanner path.

## Tests

Tests: `/bin/sh -c 'cd nodejs && corepack pnpm test --runInBand
__test__/query.test.ts -t '"'"'prefilters by keys from another
table'"'"''`.
Result: cd nodejs && corepack pnpm test --runInBand
__test__/query.test.ts on the exact-HEAD published native binary before
adding tests: 41 passed.
Result: cd nodejs && corepack pnpm test --runInBand
__test__/query.test.ts -t 'prefilters by keys from another table' on the
exact-HEAD published native binary: 2 failed with the reported
unsupported SQL expression, exit 1 (OSSCOUT_BASE.log).
Result: cd nodejs && corepack pnpm lint: passed after correcting new
fixture key style.
Result: cargo fmt --all && git diff --check: passed.
Result: cd nodejs && corepack pnpm test --runInBand --runTestsByPath
__test__/expr.test.ts __test__/remote.test.ts on the exact-HEAD
published native binary: 179 passed across 2 suites.
Result: cd nodejs && corepack pnpm tsc && corepack pnpm run docs with
the exact-HEAD native declarations: passed, with no generated
documentation changes.
Result: cd nodejs && corepack pnpm build:debug --profile ci && corepack
pnpm tsc: passed from the patched source.
Result: cd nodejs && corepack pnpm test --runInBand
__test__/query.test.ts -t 'prefilters by keys from another table' on the
source-built patch: 2 passed, exit 0 (OSSCOUT_PATCHED.log).
Result: cd nodejs && corepack pnpm test --runInBand --runTestsByPath
__test__/query.test.ts __test__/expr.test.ts __test__/remote.test.ts on
the source-built patch: 225 passed across 3 suites, exit 0
(OSSCOUT_PATCHED.log).
Result: cd nodejs && corepack pnpm run docs on the source-built patch:
passed, with no generated documentation changes.
Regression coverage: `nodejs/__test__/query.test.ts`.
<!-- oss-scout-job:job-2628acdb-66f3-4d91-8a6e-d5d15e92bde7 -->

---------

Signed-off-by: wangshun <96341168+xixi-box@users.noreply.github.com>
2026-11-30 20:38:51 +08:00
Kevin Dong 2ff3bee923 feat(node): expose ZoneMap and BloomFilter index configs (#4962)
## Summary

Refs #4931 (TypeScript portion).

Expose the existing Rust ZoneMap and BloomFilter builders through
`Index.zoneMap()` and `Index.bloomFilter({ numberOfItems?, probability?
})` for Embedded and Enterprise tables. Export `BloomFilterOptions`,
reject values that cannot be converted losslessly from a positive
JavaScript safe integer to Rust `u64`, and retain the core builder's
probability validation and defaults.

Include API examples, generated documentation, and the ZoneMap
table-capability compatibility warning. Synchronize with main while
preserving its RTree/plugin factories and source-bearing Blob APIs. The
Python portion remains separate.

## Validation

- Built the new native binding on macOS 15.7.9 / arm64 with Rust 1.98.0,
Node 24.22.1, the repository `ci` profile, locked dependencies, and
Rust's bundled LLD scoped to the Node binding. Both lockfiles match
main.
- Four full affected Jest suites: **819 passed, 3 existing
experimental-feature cases skipped**. Coverage includes index
creation/listing, range and membership plans/results, option boundaries,
Enterprise HTTP request bodies, and the newly merged Blob descriptor
API.
- Passed TypeScript compilation, Biome check/format for all 85 Node
files, generated API documentation with warnings treated as errors, Rust
formatting, and `git diff --check`.
- Independent execution in a separate writable snapshot: 56
reviewer-designed boundary cases passed on each of Node 22 and 24; 815
adjacent repository tests passed, with 3 existing skips. TypeScript,
generated docs, Biome, and the compiled package entry point passed. The
final source tree, complete diff, and freshly built native artifact
hashes matched; no actionable findings remained.

The final documentation correction was checked against the pinned Lance
source. TypeScript compilation, Biome, generated API documentation, and
all 19 index option tests passed again. Two real Embedded table probes
confirmed that default ZoneMap creation on string and binary columns
leaves the v1 reader and writer capability bits unset; the string range
query used the scalar index and returned the expected rows. A fresh
independent snapshot also passed the string/binary lifecycle probes on
Node 22 and 24 (24 manifest observations), the 19 repository index
tests, and the documentation/type/lint checks.

Enterprise checks use mock HTTP endpoints. The native linker reports
C-library minimum-macOS-version warnings, so these runs do not establish
compatibility with older macOS versions.

## Merge Danger

**Door:** two-way

The SDK additions can be reverted. ZoneMap write seeds use v0 by
default. A commit that explicitly sets `lance.zone_write_seeds.version`
to `"1"` activates a persistent reader and writer capability; readers
and writers must support it before opting in. Dropping the index or
restoring an older version does not remove that capability from
subsequent snapshots.

**Blast Radius:** TypeScript

Adds index configuration factories and NAPI bindings; reuses existing
core index creation and Enterprise serialization.
2026-11-30 20:23:00 +08:00
Divyam TalwarandDivyam Talwar ea2d9a0440 fix(node): exclude padding from Transformers embedding pooling (#5282)
## Summary

Use Transformers.js mean pooling with the tokenizer's attention mask so
padding positions do not contribute to source and query embeddings.

## Validation

- A deterministic model and tokenizer fixture uses actual
Transformers.js Tensor objects and compares the same short text embedded
alone and in a padded batch. On main its vector changes from `[1, 5]` to
`[50.5, 102.5]`. With the fix it stays `[1, 5]` and the longer text's
expected vector remains `[4, 8]`.
- Existing Transformers and embedding Jest suites on Node 24: 20 passed,
1 skipped (OpenAI key required). TypeScript build and Biome checks
passed.
- Used Transformers.js 4.3.2 with the ONNX Web tensor runtime for
fixture-only tests. Model downloads and inference were disabled.

Fixes https://github.com/lancedb/lancedb/issues/5281

---------

Co-authored-by: Divyam Talwar <DivyamTalwar@users.noreply.github.com>
2026-11-30 20:13:20 +08:00
4abb2b282c fix(node): retain deferred query promise failures until execution (#5280)
## Summary

Observe Promise-backed query preparation when the builder stores it,
including promises produced by fluent modifiers. Terminal operations
still await the original promise and receive its original rejection.

## Validation

- Both delayed-execution regressions fail on main. The new tests
exercise a plain Promise-backed builder and a builder with chained
filters, and check rejection identity.
- Native Jest query suite: 43 passed. TypeScript compilation with
`--noEmit` and Biome checks passed.
- Ran real embedded direct-Promise and forced string-vector queries with
Node's strict unhandled rejection mode. Both baseline processes exit
before execution. With the fix each process survives the delay, receives
the expected error when awaited, and successfully executes a control
query.

Fixes https://github.com/lancedb/lancedb/issues/5279

---------

Co-authored-by: Divyam Talwar <DivyamTalwar@users.noreply.github.com>
Co-authored-by: Divyam Talwar <152021174+DivyamTalwar@users.noreply.github.com>
2026-11-30 20:13:11 +08:00
Zain QureshiandClaude Opus 5.5 058d5c3f4c fix(nodejs): reject fractional branch versions (#5167)
Refs #4848

## Problem

With the table at version 2, `branches.create("exp", undefined, 1.5)`
silently forked from version 1 and left the new branch missing the
second row. With `exp` at version 3, both `branches.checkout("exp",
2.5)` and `openTable("my_table", undefined, { branch: "exp", version:
2.5 })` returned version 2 and its two rows. N-API coerced these
arguments to `i64` before Rust could validate them
(`nodejs/src/table.rs:2698` and `nodejs/src/table.rs:2743`).

## Change

`Branches.create` and `Branches.checkout` now use the existing
TypeScript integer validator before calling N-API
(`nodejs/lancedb/table.ts:2759` and `nodejs/lancedb/table.ts:2773`).
Creation rejects with `fromVersion must be a non-negative integer` and
creates no branch. Both reads reject with `version must be a
non-negative integer` because opening a named branch delegates to the
same checkout method (`nodejs/lancedb/connection.ts:830`).

Tag-based creation rejects a simultaneous source version through the
native source conflict check (`nodejs/src/table.rs:2701`). With no
branch or with `branch: "main"`, `openTable` uses `Table.checkout`
(`nodejs/lancedb/connection.ts:832`). That separate numeric checkout
path and tag version validation are covered by #4916.

## Tests

Ran from `nodejs` on macOS arm64 using the published beta.26 native
binding built from the base revision. The two regressions failed on the
base. The patched branch run passed 34 tests, and the Node suite passed
1,885 tests with 27 skipped. Live Enterprise and S3 integrations were
outside this run.

```sh
env -u OPENAI_API_KEY -u LANCEDB_API_KEY -u S3_TEST ./node_modules/.bin/jest --runInBand --runTestsByPath __test__/table.test.ts --testNamePattern='branch' --no-verbose
env -u OPENAI_API_KEY -u LANCEDB_API_KEY -u S3_TEST ./node_modules/.bin/jest --runInBand --no-verbose
./node_modules/.bin/tsc -b
./node_modules/.bin/tsc --noEmit -p __test__/tsconfig.json
./node_modules/.bin/biome ci .
```

The package's TypeDoc and postprocessing commands also passed, and the
generated JavaScript API reference matched the checked-in files.

Prepared with AI assistance (Codex and Claude Code) and reviewed with
GitHub Copilot.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 20:07:05 +08:00
lancedb-gatefixer[bot] 2d4e0fb3f2 fix: preserve branch scope during Embedded tag time travel (#4852)
Embedded tag checkout replaced the handle's only branch identity. After
reading a tag on another branch, `checkout_latest()` followed that
branch and subsequent writes or restores could commit there.

Keep the handle's original branch and Lance `BranchIdentifier`
separately from its visible snapshot. A branch name alone cannot
distinguish the original branch from a replacement after deletion and
reuse. Cross-branch tags remain readable, and Python pickle and snapshot
copies preserve both identities. `checkout_latest()` reattaches to the
original branch, so later appends stay there. `current_branch()`
continues to report the visible snapshot's branch.

Validate the retained identity before `checkout_latest()` changes the
handle or `restore(tag)` commits; a reused branch name is rejected
without changing either branch tip. Independent and query snapshot
copies retain this identity too. Reject an ambiguous cross-branch
restore before committing. To restore on the tag's branch, first open a
handle there with `branches.checkout(...)` or Rust's
`checkout_branch(...)`. Update Rust, Python sync/async, TypeScript,
generated API documentation, and the tag-based versioning guide for this
behavior.

Python pickle state also carries the original `BranchIdentifier` through
reopening. A foreign snapshot stays readable if the originating branch
is replaced while serialized, but latest checkout and restore reject the
replacement. Latest and same-branch pinned handles validate the saved
identity before reopening returns. Older pickle states without the
identifier keep their existing reopen behavior; they cannot validate an
identity that was never saved.

Validation:

- All 12 new branch-name reuse regression cases failed before the
identity fix and pass afterward. They cover latest checkout and restore,
direct handles and snapshot copies, all three consistency modes, and
unchanged versions and contents on both branch tips. Query snapshot
identity retention is also covered.
- All 8 new Python pickle regression cases failed before the
serialization fix and pass afterward. They replace the branch while the
handle is serialized, cover latest checkout and restore across three
consistency modes, verify unchanged tips, and reject replacement data
when reopening latest or same-branch pinned handles.
- 494 Rust table tests and 23 dataset consistency tests passed with
`--features remote --profile ci`; Clippy for the core and Python
bindings, Rust formatting, and `git diff --check` passed.
- 62 targeted Python tag, branch, pickle, and restore tests passed in
the uv-managed environment after rebuilding the extension. An additional
compatibility check verified that older pickle states without the
identifier still reopen and return to the original branch.
- Earlier SDK validation: 9 targeted Node tests passed, including the
cross-branch regression. Node native build, TypeScript compilation,
lint/format checks, and API documentation generation passed. TypeScript
sources are unchanged in this Python pickle follow-up.
- Python package Ruff lint/format checks passed; repository-wide Ruff
reported 59 pre-existing findings in untouched `docs/web-tests/` files.
Vale 3.24.0 found no prose issues on the changed guide lines.

Fixes #4842

<!-- lance-gatekeeper-fix:v1 agent=c1c6448a3f02ec6db445df5e3d8dd77f
generation=1 -->


<!-- gatefixer-walkthrough:v1
head=078eceadbedc15cf179d9d4dcce249c83e7010f9 -->
## Change walkthrough

```mermaid
flowchart LR
    A["Save original identity"] --> B["Reopen visible snapshot"]
    B --> C{"Foreign snapshot?"}
    C -->|No| D["Validate before return"]
    C -->|Yes| E["Retain saved identity"]
    E --> F["Validate latest or restore"]
```

**Read:** [Serialize and
reopen](https://github.com/lancedb/lancedb/blob/078eceadbedc15cf179d9d4dcce249c83e7010f9/python/python/lancedb/table.py#L4541-L4594)
→ [Reinstate identity
safely](https://github.com/lancedb/lancedb/blob/078eceadbedc15cf179d9d4dcce249c83e7010f9/rust/lancedb/src/table/dataset.rs#L278-L307)
→ [Serialized-handle
regressions](https://github.com/lancedb/lancedb/blob/078eceadbedc15cf179d9d4dcce249c83e7010f9/python/python/tests/test_table.py#L1300-L1360).

<sub>Snapshot:
[078ecea](https://github.com/lancedb/lancedb/commit/078eceadbedc15cf179d9d4dcce249c83e7010f9)</sub>
<!-- gatefixer-walkthrough:end -->

---------

Co-authored-by: Gatefixer <313497061+lancedb-gatefixer[bot]@users.noreply.github.com>
2026-11-30 20:05:58 +08:00
Tomwang.eth 855bec2a57 fix(node): make tags.list() values plain serializable objects (#4915)
Related: #4849 (same defect class on `branches.list()`, fixed in #4914).

**Problem**
`Tags.list()` returns napi class instances whose fields live on the
prototype, so `console.log`, spread and `JSON.stringify` show `{}` — the
documented example (`{ "v1": { version: 1, manifestSize: ... } }`)
doesn't match what users actually see. Property access
(`tags["v1"].version`) works, which is why the existing tests didn't
catch it.

**Change**
- `TagContents` stays a runtime napi class export: existing ESM named
imports of `TagContents` and `instanceof` checks keep working, and
existing TypeScript values remain assignable to it.
- `nodejs/lancedb/table.ts` post-processes `Tags.prototype.list()`
results, promoting `version` and `manifestSize` to own enumerable
properties on each returned instance by reusing the class getters and
setters. Values are now enumerable, spreadable and JSON-serializable
with no fields added, removed or renamed.
- TS-only: the Python SDK already returns proper dicts with both fields.

**Tests**
- New regression test in `nodejs/__test__/table.test.ts` covers the
named import and `instanceof` alongside own-enumerable keys, spread and
a JSON round-trip through `tags.list()`.
- The tag tests from #5145 are kept and pass against this change.
- Verified locally on Linux x86_64: `tsc -b`, Biome checks, and the
focused tags suite (4 passed), including `tags.create(name)` /
`tags.create(name, null)` behavior.
2026-11-30 19:14:23 +08:00
Alex Castillo González fc13fd6e98 fix(nodejs): batch OpenAI embedding requests to 2048 inputs (#4833)
`OpenAIEmbeddingFunction.computeSourceEmbeddings` in the Node SDK sent
every row in a single `embeddings.create` call. `makeArrowTable` passes
the whole source column at once, and the OpenAI embeddings endpoint
accepts at most 2048 inputs per request, so `table.add` (or
`createTable`) with more than 2048 rows and an `openai` embedding
function fails with a 400.

This splits the input into chunks of at most 2048 and concatenates the
results in order. Inputs of 2048 rows or fewer still make one request,
as before.

Test: `nodejs/__test__/embedding_openai.test.ts` mocks `openai`
(rejecting requests with more than 2048 inputs) and checks that 5000
rows produce 5000 embeddings, in order, over three calls (2048, 2048,
904). It fails without the change and passes with it.

This change was prepared with AI assistance (Claude Code).
2026-11-30 19:14:00 +08:00
Xuanwo 7a2182c95b docs(nodejs): clarify macOS prebuilt binaries are Apple silicon only (#5244)
The Node.js README lists Intel Macs among the platforms that receive a
native binary from npm. The macOS package is published for Apple silicon
(`arm64`) only. Intel Mac users can follow the [source-build
instructions](https://github.com/lancedb/lancedb/blob/main/nodejs/CONTRIBUTING.md#development).

Refs #3149 and #4765.
2026-11-30 18:04:49 +08:00
Muhammad Abdullah ButtandXuanwo 8a00ca58ea fix(nodejs): send Lance time units when altering timestamp or duration columns (#5196)
`alterColumns` serializes an Arrow `dataType` with `dataTypeToJson`. For
`Timestamp` and
`Duration` it wrote apache-arrow's numeric `TimeUnit` value into the
type string, so a cast to
`new TimestampMicrosecond()` was sent as `timestamp:2:-` and
`Duration(MICROSECOND)` as
`duration:2`. Lance only parses the units `s`, `ms`, `us` and `ns`, so
every such alteration
failed with `Invalid data type: {"type":"timestamp:2:-"}`.

This maps `TimeUnit` to Lance's unit strings for both types.

Tests:
- arrow.test.ts: checks `dataTypeToJson` output for all four units of
both types, with and
without a timezone. It fails on main (`timestamp:0:-`) and passes with
the fix.
- table.test.ts: "can cast to various types" now also alters
timestamp[ms] and duration[ms]
  columns to microseconds and checks the schema.

I couldn't build the native module locally, so the arrow.test.ts run
used the released 0.37.1 binary, and the table.test.ts steps were
checked as a standalone script against that package rather than under
jest.

I made this change with help from Claude Code, and I reviewed the diff
and the test results myself.


---------

Co-authored-by: Xuanwo <github@xuanwo.io>
2026-11-30 16:49:51 +08:00
Xuanwo e185dc8646 perf: raise the default Blob V2 direct-read threshold to 32 MiB (#5248)
Enterprise SDKs use an inclusive 32 MiB default for eligible Blob V2
direct reads. The paired field comparison with the 10 MiB SDK default
measured higher direct-read latency at 10 and 16 MiB. At 32 MiB, the
interval for the latency difference spanned zero. [SDK version used in
the field comparison](https://github.com/lancedb/lancedb/pull/5247)

The earlier mixed-load test measured lower Plan Executor cache pressure
with direct reads enabled at the 10 MiB cutoff. That result covers the
tested size mix. With the 32 MiB cutoff, reads from 10 MiB up to (but
excluding) 32 MiB go through the proxy, so the impact on executor
traffic and cache pressure depends on the workload's size distribution.

The existing internal override still takes precedence. Direct reads keep
the 16 MiB part size. The Node binding test verifies proxy routing one
byte below the default and two contiguous object-store ranges with a
matching SHA-256 at exactly 32 MiB.
2026-11-28 03:21:37 +08:00
Xuanwo 129028f300 perf: improve presigned Blob V2 reads (#5247)
## Behavior

Presigned Blob V2 reads retry an idempotent ranged GET once after a
recognized disconnect or timeout before the complete response headers
arrive. This includes an abrupt TLS EOF while receiving the headers. A
retry preserves the physical Range and the still-valid URL. Expiry
triggers resolution on the pinned snapshot. Once the complete headers
arrive, the existing status and body paths handle the response.
Enterprise connections default to a 300-second pool idle timeout and
presigned object-store connections default to 30 seconds. The existing
override applies to both pools.

Loopback TCP tests exercise FIN and RST on a reused connection, both
with zero response bytes and after a partial header. They verify the
send count with retries enabled and disabled, the exact replayed Range
and the payload digest. A truncated body after complete headers returns
an error after one send.

Direct reads over 16 MiB stream bounded physical ranges into their
corresponding slices of the final buffer. The per-read fan-out uses
Lance's `LANCE_IO_THREADS`, capped by the connection's existing
`LANCE_CLIENT_BLOB_REQUEST_CONCURRENCY` limit (8 by default). Each
request retains its permit through body consumption. The 10 MiB routing
threshold continues to apply to the full logical read.

The connection can reuse unexpired presigned locations for verified rows
under the same table, column, snapshot and request credentials. Range
offsets and sizes come from the resolver. The existing batch request
covers the requested rows of a shared Packed or Managed sidecar.
Reopening a verified row uses its prior resolution, and the first open
of each unseen SQL descriptor still authorizes just that row. The public
API and REST response format are unchanged.
2026-11-28 02:29:31 +08:00
Lance Release fdc8041b2a Bump version: 0.42.0-beta.37 → 0.42.0-beta.38 2026-11-27 09:41:44 +00:00
Bilal Atique 09beba532e feat(node): accept Expr values in select() (#4878)
Closes #3042.

Node `select()` now takes `Expr` values, the same expression builder
that `where()` already accepts. A `Map` or a plain object can mix `Expr`
values and SQL strings:

```ts
import { col } from "@lancedb/lancedb";

const rows = await table
  .query()
  .select({
    id: "id",
    name: col("firstName"),
    total: col("unitPrice").mul(col("quantity")),
  })
  .toArray();
```

This works on every query with `select()`: `query()`, `vectorSearch()`,
`search()` and the take queries. The parameter type is now `Map<string,
string | Expr>` and `Record<string, string | Expr>`. Nothing else in the
TypeScript API changes.

### How it works

`select()` turns each `Expr` into SQL with `toSql()` and passes the
pairs to the native `select` that SQL strings already use. `where()`
handles an `Expr` the same way, so Node treats expressions alike in both
places. `toSql()` quotes camelCase names and SQL keywords with
backticks, so `col("firstName")` reads `firstName`.

I also looked at passing the expressions to Rust as `Select::Expr`, as
Python's `select_expr` does. I didn't go that way:

- Before a local or remote query runs, Rust turns `Select::Expr` back
into SQL with the same `expr_to_sql_string`. The query is the same
either way.
- A map that mixes SQL strings and expressions can't become a
`Select::Expr` without parsing the strings. Python's `AsyncQuery.select`
sends a mixed dict through `select_expr` and wraps each string with
`lit()` (`_coerce`), so `select({"id": "id", "doubled": col("score") *
lit(2)})` returns the string `'id'` in the `id` column. Sending SQL
keeps every string a SQL expression.
- I found one path that accepts `Select::Expr` and rejects
`Select::Dynamic`: namespace `QueryTable` pushdown. Node can't turn
pushdown on today, so nothing changes yet. If Node gets that option,
`select()` can send `Select::Expr` when every value is an `Expr`.

`blobMode: "bytes"` (#4353) finds blob columns by name in the `[output,
source]` list of the selection. For a camelCase column, `toSql()` gives
`` `imageData` ``, which doesn't match `imageData`. So when an `Expr` is
a bare column reference, the match uses its plain name. For this, the
native `Expr` gets a small `columnName()` helper, like `column_name()`
in the Python bindings, which Python uses for the same match. A blob
renamed with `col()` gets its bytes, as with a SQL string. Other
expressions are not filled with bytes, as before.

A value that is neither a string nor an `Expr` now throws a `TypeError`
that names the key, instead of the native conversion error.

### Tests

New tests in `expr.test.ts`:

- a `Map` that mixes SQL strings with `col("firstName")` and
`col("unitPrice").mul(2)` on a plain query, with the column order
- a `Record` with `upper()`, `func("lower", ...)` and a SQL string,
filtered with an `Expr` in `where()`
- `Expr` values on a vector query, an automatic `search()` (full-text
search) and a take query
- `blobMode: "bytes"` with a camelCase blob column selected with
`col()`: renamed, next to a computed `Expr` column, and in a take query
- a number as a value throws a `TypeError`

The whole Node suite passes. The Node docs under `docs/src/js` are
regenerated. The `@example` in the middle of the `select()` docstring
used to swallow the two paragraphs after it into the code block, so I
moved the example to the end, which is why each query class page
changes.

Left out: `Expr` items in the plain column list (`select([col("a")])`),
because an expression needs an output name. The `select` of a
materialized view still takes SQL strings only.
2026-11-27 17:10:43 +08:00
Lance Release e38d8bef56 Bump version: 0.42.0-beta.36 → 0.42.0-beta.37 2026-11-27 03:36:01 +00:00
LanceDB RobotandXuanwo 344a4d1444 chore: update lance dependency to v16.0.0-beta.4 (#5242)
Update the Rust and Java Lance dependencies to
[v16.0.0-beta.4](https://github.com/lance-format/lance/releases/tag/v16.0.0-beta.4)
and pin Python tests to pylance 16.0.0b4. Make the Node.js Rust blob
parser helper private so strict workspace Clippy passes.

---------

Co-authored-by: Xuanwo <github@xuanwo.io>
2026-11-27 11:34:27 +08:00
Xuanwo 1c0118015c feat(nodejs): open source-bearing blob descriptors (#5238)
Add `Table.openBlobFile` and `Table.openBlobFiles` for source-bearing
SQL `blob_descriptor` results, matching the existing Rust and Python
APIs.

The TypeScript methods forward the descriptor to the shared Rust opener
instead of reimplementing routing. That keeps the 10 MiB direct-read
threshold, pinned snapshot identity, resolver refresh, and 503
single-shot proxy fallback identical to `fetchBlobFiles` and the other
public Blob V2 entries. Descriptor fields remain the snake_case shape
returned by Arrow/SQL; the wrapper converts unsigned 64-bit values to
`bigint` at the NAPI boundary and returns `null` for null descriptors.
Existing custom `Table` subclasses keep working through a default "not
supported" implementation.

Validation:
- `pnpm tsc`
- `pnpm lint`
- `pnpm test --runInBand __test__/blob_open.test.ts
__test__/blob_ranges.test.ts __test__/remote_blob_snapshot.test.ts` — 65
passed
- focused Rust core tests for direct opens, threshold routing, snapshot
preservation, and 503 fallback — passed

The docs also update the TypeScript cross-row range table and example;
`fetchBlobRanges` was already implemented but was still documented as
unavailable.
2026-11-27 00:16:29 +08:00
Lance Release 85dcf3a3c5 Bump version: 0.42.0-beta.35 → 0.42.0-beta.36 2026-11-26 15:06:40 +00:00
Lance Release 0adfd22db1 Bump version: 0.42.0-beta.34 → 0.42.0-beta.35 2026-11-26 10:50:09 +00:00
Lance Release 9adb403656 Bump version: 0.42.0-beta.33 → 0.42.0-beta.34 2026-11-26 03:33:13 +00:00
Lance Release 7c3d68e951 Bump version: 0.42.0-beta.32 → 0.42.0-beta.33 2026-11-25 23:49:08 +00:00
Lance Release 7e1478b547 Bump version: 0.42.0-beta.31 → 0.42.0-beta.32 2026-11-25 21:41:10 +00:00
Lance Release 8441dab874 Bump version: 0.42.0-beta.30 → 0.42.0-beta.31 2026-11-25 21:32:03 +00:00
Xuanwo 4d9fd358f8 feat(nodejs): expose Function failure recovery APIs (#5209)
TypeScript callers can now inspect and recover Function row failures
through the native workflow. `functionErrors()` groups returned failures
and can show retained attempt history. `functionErrorRows()` looks up
current failed inputs using row IDs and physical row addresses
represented as `bigint`. Older deployments can continue to use the
existing error listing.

`retryFailed()` selects the exact failed rows on the server, with
optional error type and job filters. `upgradeColumn()` binds an existing
immutable Function version and can recompute failed rows, all eligible
rows, or no rows. Callers can quarantine and release failures,
explicitly include quarantined rows in a retry, and use
`functionProvenance()` to see which Function version produced a recorded
value.

The native operations reuse the existing Rust workflow v1 capability
checks. The Function failures guide includes TypeScript examples for
inspecting, retrying, upgrading, and quarantining failures.
2026-11-25 23:14:04 +08:00
Lance Release a709c6db1e Bump version: 0.42.0-beta.29 → 0.42.0-beta.30 2026-11-25 03:11:25 +00:00
Sarwar BhuiyanandClaude Opus 5.5 5f87e18541 feat: create any registered Lance scalar index plugin by name (#5004)
Closes #4933

Adds a generic configuration for creating a scalar index of any type
recognized by a registered database plugin, using its type name and
optional JSON parameters. Index types without a dedicated SDK
configuration can use the same API.

- **Rust:** `Index::Plugin(PluginIndexBuilder)`, with JSON-object
parameters through `.params(...)` or `.params_json(...)`.
- **Python:** `ScalarPlugin(index_type, params=None)`, accepting a dict
or JSON-object string.
- **TypeScript:** `Index.plugin(indexType, params?)`, accepting an
object or JSON-object string.
- Type names are case-insensitive and surrounding whitespace is ignored.
Empty names and non-object parameters are rejected.
- Native index introspection preserves existing built-in types and
exposes other registered plugin types through `Custom`.

The guide and SDK references describe index creation, parameter
ownership, and errors consistently. They recommend a dedicated
configuration when one exists and refer readers to the plugin’s
documentation for parameter names and defaults. The TypeScript reference
is regenerated from its source JSDoc.

## Remote request format

Generic requests use `index_type: "PLUGIN"` and a separate upper-cased
`plugin_type`. Arbitrary parameters stay nested under `params`,
preserving omitted parameters versus an explicit empty object. This
separates the generic path from built-in handling and prevents
parameters from overwriting request fields.

## Validation

- 52 targeted tests passed: 15 Rust, 22 Python, and 15 TypeScript.
- Two Rust plugin doctests passed.
- Rust Clippy, the Node build and lint, changed-file Python lint,
TypeDoc generation, Vale, and the MkDocs SDK-reference build passed.
- Request tests cover Python sync/async calls, object and JSON-string
inputs, normalization, omitted and empty parameters, and collisions with
request metadata.
- Repository-wide Ruff reports existing findings in untouched
documentation examples. Strict Mintlify validation reports four missing
snippet-export warnings, also reproduced on the unmodified commit.

## Follow-ups

- Replace the built-in examples with a widely available custom plugin
when one is available, as discussed in review.
- Remote `list_indices()` and `index_stats()` still parse a fixed set of
type names; accepting unrecognized plugin types through a `Custom`
fallback remains separate.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 07:00:47 -08:00
Lance Release 03b861f9a0 Bump version: 0.42.0-beta.28 → 0.42.0-beta.29 2026-11-24 11:46:34 +00:00
Lance Release abe829f4a3 Bump version: 0.42.0-beta.27 → 0.42.0-beta.28 2026-11-24 09:20:21 +00:00
Lance Release f6bb017535 Bump version: 0.42.0-beta.26 → 0.42.0-beta.27 2026-11-24 07:13:40 +00:00
Lance Release de81c35ba0 Bump version: 0.42.0-beta.25 → 0.42.0-beta.26 2026-11-23 06:14:22 +00:00
Lance Release b5ec7d6af4 Bump version: 0.42.0-beta.24 → 0.42.0-beta.25 2026-11-23 02:50:01 +00:00
Lance Release f38d42e9db Bump version: 0.42.0-beta.23 → 0.42.0-beta.24 2026-11-22 21:22:21 +00:00
Lance Release b654cd42ae Bump version: 0.42.0-beta.22 → 0.42.0-beta.23 2026-11-22 18:55:29 +00:00
Lance Release 21f074cb02 Bump version: 0.42.0-beta.21 → 0.42.0-beta.22 2026-11-22 14:27:15 +00:00
Yang Cen d9b49e8889 feat: report capacity waits in function refresh job status (#5154)
An Enterprise Function refresh can spend time waiting for execution
workers. Applications polling `job.status()` currently see `running`
during that wait. Return `waiting_for_capacity` when the server reports
that phase for an active Function refresh. The next status request
reports `running` when execution resumes. Applications can use
`job.wait()` to wait through both states until completion.

Rust, Python and Node read the phase from the existing job description
response.

## Validation

Two HTTP regression tests exercise the public job handle. They cover the
wait, work resuming, completion after another wait, a stale phase at
completion, queued and paused refreshes, other job types, and servers
that omit the phase. The Rust CI remote job runs these tests.
2026-11-22 16:00:50 +08:00
Jack Ye 2b1b2a29dd feat!: layer GPU settings and total execution limits (#5146)
BREAKING CHANGE: Resource inputs use the same names at Function
registration, column/MV creation, and refresh. Use total_cpu_millis,
total_memory_bytes, and total_gpu_count for execution-wide worker
budgets, plus gpu_class and positive gpu_count for each worker. Replace
budget dictionary inputs and unprefixed aggregate limits with these
fields. Move existing refresh gpu_count caps to total_gpu_count;
gpu_count now selects devices per worker.

Each setting resolves independently: refresh > column/MV creation >
Function annotation > deployment. Creation settings also apply to
initial MV population and automatic refresh. MVs sum total budgets
across distinct pinned Function versions; per-worker GPU counts use the
largest Function default unless overridden. An unset GPU class resolves
to gpu_class="any" after inheritance; an explicit "any" overrides a
registered concrete class. Use gpu_class="default" to pin the default
pool explicitly.

```python
@function(
    gpu=True, gpu_class="h100", gpu_count=2,
    total_cpu_millis=8000,
    total_memory_bytes=16 * 1024**3,
    total_gpu_count=4,
)
def embed(text: str) -> list[float]: ...

version = db.create_function(embed)
table.add_columns(
    {"embedding": version(text=col("text"))},
    gpu_class="any", gpu_count=1, total_gpu_count=8,
)
table.refresh_column_async(
    "embedding", gpu_class="h100", gpu_count=4, total_gpu_count=8,
)

mv = db.create_materialized_view(
    "embeddings", query="SELECT embed(text) AS embedding FROM documents",
    gpu_class="any", gpu_count=2, total_gpu_count=8,
)
mv.refresh(gpu_count=4, total_gpu_count=8)
```

```mermaid
flowchart TD
    R["Refresh settings"] --> E["Effective settings, resolved per field"]
    D["Column or MV creation settings"] --> E
    F["Function settings"] --> E
    C["Deployment defaults"] --> E
    E --> W["GPU class and device count per worker"]
    E --> T["Total CPU, memory and GPU ceilings"]
```

Pinned Function images retain their identity. Registration GPU counts
are defaults; execution overrides determine worker allocation. Admission
rejects GPU counts below an image's minimum requirement or above the
total budget. Python, Rust, SQL/REST and supported TypeScript operations
use the same resource model.

No local builds or tests, as requested; regression coverage runs in CI.
2026-11-21 15:04:34 -08:00
Lance Release b35cce60d6 Bump version: 0.42.0-beta.20 → 0.42.0-beta.21 2026-11-21 08:53:41 +00:00
Jack Ye 0511aed6e9 feat: profile Enterprise Function workers from official clients 2026-11-21 00:51:08 -08:00
Jack Ye 49dedd4329 fix: expose Function metadata in SDK job listings (#5096)
Expose affected columns, pinned Function name/version, completion time,
duration and failure summaries on `JobInfo` in the Rust, Python and
TypeScript SDKs. Values come from the listing response, so callers can
inspect recent computed column refreshes without opening every job.
Older servers keep optional values absent; measured zero durations stay
zero.

```python
latest = next((info for info in db.list_jobs(table="events", job_type="function_refresh") if "embedding" in info.columns), None)
if latest is not None:
    print(latest.function_name, latest.function_version, latest.duration_millis)
    if latest.failure is not None:
        print(latest.failure.message)
```

Duration is creation-to-completion wall time, including queueing and
pauses. Adds listing response coverage across SDKs and documents the
metadata contract, including SQL `SHOW JOBS EXTENDED` for the expanded
listing. Plain `SHOW JOBS` preserves its original columns. Local builds
and tests were skipped as requested.

The dependency advisory check also fails on current main because
`libsais-rs 0.2.0` is yanked ([main
job](https://github.com/lancedb/lancedb/actions/runs/44470513618/job/135378545456));
this PR does not change dependencies.

This changes the public shape of Rust and TypeScript `JobInfo`: callers
constructing summaries must supply the added fields (including
TypeScript `columns`). TypeScript table filtering remains a separate
concern; the guide now shows its client-side selection and namespace
limitation alongside Python and Rust server-side filters.

Refs ENT-3903.
2026-11-21 00:18:29 -08:00
Xuanwo 6a7a2c4ec0 feat(nodejs): add table delta streams (#5149)
Adds the Embedded `Table.delta` API to the Node.js bindings, matching
the Rust/Python contract from #5135. `Table.delta(fromVersion,
toVersion?)` accepts a positive safe-integer number, a positive lossless
u64 `bigint`, or a same-branch tag string. `TableDelta` exposes
`beginVersion`/`endVersion` as `bigint`, streaming `insertedRows()`,
`updatedRows()`, `upsertedRows()`, `deletedRowIds()`, and
`listTransactions()` with `readVersion` as `bigint`.

Readers reuse the existing native Arrow IPC iterator adapter. They are
lazy, single-use, serialize pulls, capture/cache the schema before
polling, and release the native stream on completion, break, or error.
Row readers retain the Rust contract: equal endpoints return empty
streams with schemas, invalid/reversed/missing endpoints and
cross-branch tags are rejected, and Restore or incomplete transaction
history fail closed with full-rescan and range-end checkpoint guidance.
Enterprise tables remain unsupported through the native Rust default.

The abstract `Table` keeps a concrete unsupported `delta` default for
custom subclasses; `LocalTable` overrides it. TypeDoc API docs and
focused Node tests cover pinned targets, typed bigint values,
transaction listing, lazy rejected readers, schema/decode failures,
aliasing, and early drop.

Refs OSS-2860
2026-11-21 15:43:16 +08:00
Jack Ye b44807e4db fix!: preserve job attempt lineage, retries, and lifecycle states
BREAKING CHANGE: JobDescription, JobEventsRequest, FunctionErrorsRequest, and FunctionErrors gain optional Rust metadata/cursor fields. Existing struct literals must initialize them; use None when unavailable.

Preserve typed attempt state, pinned retry lineage, result decoders and freshness fences, and retained diagnostic paging across SDKs. Keep Python job data access method-only.
2026-11-20 20:35:59 -08:00
Xuanwo 61cabf1ccb feat(nodejs): add tag-based branch creation and default tag versions (#5145)
Node.js did not provide parity with the Python tag fixes in #5136.
`tags.create()` required an explicit version, and `branches.create()`
could not fork from a tag without resolving a numeric version that loses
the tag's branch identity.

This adds Node.js parity:

- `tags.create(tag, version?)` defaults an omitted version to the
version visible to the table handle, including checked-out and
time-travel handles. Explicit versions are unchanged.
- `branches.create(name, { fromTag })` forks through `Ref::Tag`,
preserving the tag's branch and version. Existing `create(name,
fromRef?, fromVersion?)` calls are unchanged. Mixing `fromTag` with
another source is rejected before `main` normalization.
- A missing Embedded branch keeps its original error and now includes
the actual `branches.create(..., { fromTag: ... })` call as guidance.
Enterprise 404s keep their original error without guessing from the
message.
- Enterprise uses the existing tag resolution and branch-create wire
contract; no wire changes.

The released web guide remains on the published package examples. The
new API is documented in the TypeScript API reference and source, with
Node regression coverage.
2026-11-21 06:53:10 +08:00
Bruno Ramirez baea02eebd feat: add cleanup jobs and previews across SDKs (#5107)
LanceDB SDK users connected to Enterprise had no explicit API to submit
durable cleanup or preview its work; Python's existing cleanup helper
remained a warning-only no-op. This PR adds the SDK support for
[ENT-2687](https://linear.app/lancedb/issue/ENT-2687) through public SQL
and Job APIs. It requires a compatible Enterprise release supporting
`VACUUM`, JSON preview and result format version 1. Existing
cleanup/optimize helpers retain their behavior; the new APIs reject
Embedded and historical-version handles.

This was accomplished with the following changes:

- Add `cleanup_async()` / `cleanupAsync()` and `explain_cleanup()` /
`explainCleanup()` in Python sync/async, TypeScript and Rust.
- Preserve the handle's namespace/branch and resolve retention as
invocation → table/branch TTL → deployment default. Omission inherits,
zero is explicit, and malformed options fail rather than being
discarded.
- Require one nonempty durable SQL receipt, preserving diagnostics
without REST fallback, query-ID substitution or automatic resubmission
after ambiguous acceptance.
- Add versioned `CleanupPlan` estimates and `CleanupResult`
measurements. Preview creates no cleanup job or reservation; results
preserve known zero, unknown retry/recovery totals and nonfatal failed
deletes, excluding auxiliary sweeps.
- Retain typed results on reopening and reuse shared
status/progress/events/wait/cancel APIs. Timeout leaves work running;
cancellation cannot undo deletion or prove storage I/O stopped.
- Document Ownership/parent Usage and required coordination at every
retention value: disable/drain automatic cleanup and prevent competing
cleanup, tag creation/update, branch creation and restore across all
clients until completion. The server does not enforce exclusion;
concurrent restore can leave the current table unreadable.
- Update Python's legacy no-op warning and the maintenance, Python, Rust
and generated TypeScript references.

| Interface | Submit with seven-day retention |
| --- | --- |
| SQL | `VACUUM events WITH (min_age_seconds = 604800);` |
| CLI | `lancedb admin table cleanup --table events --min-age-seconds
604800 --wait` |
| Python | `job = table.cleanup_async(min_age_seconds=604800)` (use
`await` with AsyncTable) |
| TypeScript | `const job = await table.cleanupAsync({ minAgeSeconds:
604800 });` |
| Rust | `let job =
table.cleanup_async(CleanupOptions::new().min_age_seconds(604800)).await?;`
|

### Testing

Added submission/preview, validation, typed-result and reopening tests,
and updated the legacy no-op warning assertion. Focused Python
cleanup/Job and compaction/prewarm regressions passed, alongside **34
TypeScript** and **46 Rust** tests. **31 end-to-end scenarios** passed
against a real Enterprise server, covering CLI/SQL/REST/SDK submission,
retention precedence, restart/reopening, timeouts, cancellation and
branch/namespace isolation.

Local native SDK validation used a separate `libsais-rs 0.2.0` lockfile
because the registry could not resolve `0.2.4`; this PR retains main's
dependency pins and lockfile.
2026-11-20 14:34:07 -08:00
dependabot[bot] e0995c39c2 chore(deps): bump @opentelemetry/sdk-metrics from 2.12.0 to 2.12.1 in /nodejs (#5051)
Bumps the nodejs-deps group in /nodejs with 1 update:
[@opentelemetry/sdk-metrics](https://github.com/open-telemetry/opentelemetry-js).

Updates `@opentelemetry/sdk-metrics` from 2.12.0 to 2.12.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/open-telemetry/opentelemetry-js/releases">@​opentelemetry/sdk-metrics's
releases</a>.</em></p>
<blockquote>
<h2>v2.12.1</h2>
<h2>2.12.1</h2>
<h3>🐛 Bug Fixes</h3>
<ul>
<li>fix(resources): specify full path for ioreg command on Darwin, and
kenv command on BSD for <code>host.id</code> <a
href="https://github.com/trentm"><code>@​trentm</code></a></li>
<li>ci: update the W3C harness for Python 3.14 <a
href="https://redirect.github.com/open-telemetry/opentelemetry-js/pull/7236">#7236</a>
<a
href="https://github.com/adityareddy-dev"><code>@​adityareddy-dev</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/open-telemetry/opentelemetry-js/blob/v2.12.1/CHANGELOG.md">@​opentelemetry/sdk-metrics's
changelog</a>.</em></p>
<blockquote>
<h2>2.12.1</h2>
<h3>🐛 Bug Fixes</h3>
<ul>
<li>fix(resources): specify full path for ioreg command on Darwin, and
kenv command on BSD for <code>host.id</code> <a
href="https://github.com/trentm"><code>@​trentm</code></a></li>
<li>ci: update the W3C harness for Python 3.14 <a
href="https://redirect.github.com/open-telemetry/opentelemetry-js/pull/7236">#7236</a>
<a
href="https://github.com/adityareddy-dev"><code>@​adityareddy-dev</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/open-telemetry/opentelemetry-js/commit/8795a06d2c025d5dc454d85cec785849844cc5d9"><code>8795a06</code></a>
chore: prepare next v2.x release (<a
href="https://redirect.github.com/open-telemetry/opentelemetry-js/issues/7296">#7296</a>)</li>
<li><a
href="https://github.com/open-telemetry/opentelemetry-js/commit/66a9cddb49bc01fcce1220f586dd8d2029814e55"><code>66a9cdd</code></a>
ci: update W3C harness for Python 3.14 (<a
href="https://redirect.github.com/open-telemetry/opentelemetry-js/issues/7236">#7236</a>)
(<a
href="https://redirect.github.com/open-telemetry/opentelemetry-js/issues/7295">#7295</a>)</li>
<li><a
href="https://github.com/open-telemetry/opentelemetry-js/commit/55398d41c4e2174ab7fa40ed4cc3a3d2d44b337f"><code>55398d4</code></a>
fix(resources): specify full path for ioreg command on Darwin, and kenv
comma...</li>
<li><a
href="https://github.com/open-telemetry/opentelemetry-js/commit/f698f0ce71852c1743bc35ee077e31b61f636743"><code>f698f0c</code></a>
ci: drop 'latest' dist-tag option from v2.x publish workflow (<a
href="https://redirect.github.com/open-telemetry/opentelemetry-js/issues/7222">#7222</a>)</li>
<li>See full diff in <a
href="https://github.com/open-telemetry/opentelemetry-js/compare/v2.12.0...v2.12.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@opentelemetry/sdk-metrics&package-manager=npm_and_yarn&previous-version=2.12.0&new-version=2.12.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-19 10:25:27 -08:00