Commit Graph
3863 Commits
Author SHA1 Message Date
Jacky Hsu 82620b1b8e docs: fix the hybrid search walkthrough (#5334)
## Summary

- Import `lancedb` before the Embedded Python connection example uses
it.
- Explain how to use the default RRF reranker when skipping the optional
setup step in Python or TypeScript.

## Testing

- Ran the original walkthrough in fresh Python 3.12 and Node.js 24
processes. The Python connection raised `NameError`, and skipping the
optional reranker setup raised `NameError` in Python and
`ReferenceError` in TypeScript.
- Ran the updated steps with the published LanceDB 0.42.0 Python and
Node SDKs, real Embedded tables and full-text indexes, and deterministic
test embeddings. Both explicit and default RRF returned the same four
rows in the same order and with the same relevance scores in each SDK.

- Checked the edited page with Vale 3.24.0 and checked the staged diff.

AI assistance disclosure. OpenAI Codex reproduced the errors, prepared
the documentation change, and ran the checks.
2026-12-02 03:25:56 +08:00
Xuanwo 108e8183e1 fix(ci): increase swap for Linux ARM Python wheels (#5333)
Both Linux aarch64 wheel variants intermittently lose the final
`lancedb-python` rustc process during fat LTO. The affected runners
reported 31 GiB of RAM and 16 GiB of configured swap, and the logged
Docker invocation supplies no explicit memory cap. The same runner image
has also completed wheel builds, so the historical logs leave the source
of SIGKILL undetermined. [Standard wheel
failure](https://github.com/lancedb/lancedb/actions/runs/46692473826/job/142804749599)
· [Free-threaded release
failure](https://github.com/lancedb/lancedb/actions/runs/46648917509/job/142722631114)

Give the two native ARM wheel builds 32 GiB of swap through their shared
composite action. This keeps fat LTO and one codegen unit, which
preserve release wheel size headroom, and keeps the existing manylinux
platform and ABI tags. Record the build container's memory and swap
peaks and OOM counters on exit, with kernel and systemd-oomd logs on
failed native ARM jobs.
2026-12-02 03:09:15 +08:00
Jacob Bandes-Storch 5d455e4b4f feat(rust): expose progress callbacks for create_index (#4245)
This adds a `.progress()` option to `IndexBuilder` and plumbs it through
`create_index` to the lance `CreateIndexBuilder`.

There was already a progress callback usable with `table.optimize()` via
`OptimizeOptions`, but it was not exposed for `table.create_index()`,
although the underlying lance methods support it.
2026-12-02 02:07:51 +08:00
193c9d8e2e docs: fail docs build on warnings (#3707)
## Summary

- run the existing MkDocs deployment build in strict mode
- turn documentation warnings, including unresolved references, into CI
failures instead of deploying them

## Why

The docs workflow currently completes when MkDocs emits warnings. Using
MkDocs' built-in strict mode makes the deployment stop on those warnings
and surfaces documentation problems immediately. This addresses the
warning-detection portion of #572 without adding another dependency or
duplicating the docs build.

## Validation

- `git diff --check`
- parsed `.github/workflows/docs.yml` with PyYAML
- full `mkdocs build --strict` was not run locally because MkDocs is not
installed; the existing docs workflow has the required dependencies

---------

Co-authored-by: Will Jones <willjones127@gmail.com>
Co-authored-by: Xuanwo <github@xuanwo.io>
2026-12-02 02:03:26 +08:00
Bruno Ramirez a0ff67e13e feat(cli): publish a source distribution for lancedb-tools (#5314)
The `lancedb-tools` release contains wheels for Apple Silicon and two
Linux architectures. Users on Intel macOS have no compatible wheel, so
the Python installer has no way to install the CLI. This extends the
release workflow from #5313 to build a source distribution from the same
tag and check the source fallback before the release team approves
publication.

This was accomplished with the following changes:

- Package the tagged Rust CLI, workspace manifests, lockfile, and
licenses with a setuptools-rust binary target.
- Install by package name on a native Intel macOS runner with all four
release files available, then check that pip selected the sdist and
built a working x86-64 executable.
- Upload the tested sdist alongside the wheels and verify its published
SHA-256 digest.
2026-12-01 09:13:57 -08:00
Yang Cen cf59298934 fix(query): apply cosine candidate bounds once per ANN branch (#5330)
An indexed cosine query with an unindexed tail can lose valid rows when
its distance range has a positive lower bound. Lance now translates the
candidate bounds for exact rescoring. Replanning the ANN branch with
doubled inputs can translate them a second time. A public range of
`[0.10, 0.16)` then reaches the index as `[0.40, 0.64)`.

The SDK checks the candidate bounds on each quantized cosine ANN node.
If Lance already supplied the normalized squared-L2 bounds, the SDK uses
that node. Exact fallback and refinement keep their original range, and
returned distances use the public cosine scale.

The regression compares indexed results against a brute-force scan after
appending an out-of-range vector. It exercises modern and legacy IVF_PQ,
single-query refinement, and modern batched queries with and without
refinement. Rust formatting and whitespace checks passed. Project CI
runs the behavioral tests.
2026-12-01 23:02:29 +08:00
George KhananaevandXuanwo ec230318f6 fix: point the compaction warning at the current docs page (#4913)
Refs #4371

The link checker flags
`https://docs.lancedb.com/performance#compaction-and-cleanup` because
that section no longer exists. Compaction has its own page now, and its
"When to run it" section (`#when`) covers the warning this link is
attached to: tables with many small fragments.

This points `DocLink::Compaction` at `/maintenance/compaction#when` and
updates the two tests that hard-code the URL. The anchor exists on the
published site and in `docs/web/maintenance/compaction.mdx`, so
`test_all_doc_links_resolve_in_repo_docs` still holds.

Tests: `python -m unittest ci.tests.test_extract_sdk_doc_links` and
`cargo test -p lancedb --lib docs::tests::` pass locally.

Co-authored-by: Xuanwo <github@xuanwo.io>
2026-12-01 22:09:04 +08:00
BHAWESHBHASKARandXuanwo fb853bae75 feat(nodejs): expose the NGram scalar index (#4908)
The Rust core (lancedb::index::scalar::NGramIndexBuilder) and the Python
SDK already support the NGram scalar index, and the Node.js SDK can
create one on Embedded with `Index.plugin("ngram")`. This change adds a
dedicated `Index.ngram()` factory. NGram is a scalar index on a UTF-8
string column that accelerates substring filters such as contains(col,
'needle'), along with some LIKE and regular-expression predicates, by
narrowing a scan to rows that share the query's trigrams.

Add an ngram() napi factory and Index.ngram() in the TypeScript SDK,
mirroring the existing btree and fm scalar index factories, with tests
for both factories. On Embedded, the query plan uses the index and the
exact substring filter excludes rows that only share the query’s
trigrams. On Enterprise, `Index.ngram()` sends `index_type: "NGRAM"`,
while `Index.plugin("ngram")` sends `index_type: "PLUGIN"` with
`plugin_type: "NGRAM"`.

---------

Co-authored-by: Xuanwo <github@xuanwo.io>
2026-12-01 21:39:01 +08:00
SHAIK SHIVAJIandXuanwo 144c07cee3 feat(nodejs): expose code analyzer options on FtsOptions and tokenize (#4889)
Completes #4364 together with #4756, which did the Python side.

## Changes

- `Index.fts()` / `FtsOptions` and `tokenize()` gain `analyzer`
(`"text"` or `"code"`), `splitIdentifiers`, `splitOnNumerics`,
`preserveOriginal` and `indexOperators`. All are optional, so existing
indexes and calls behave as before.
- Validation matches the Python SDK: `analyzer: "code"` with a
`baseTokenizer` other than `"code"` or `"simple"` is rejected,
`analyzer: "text"` with `baseTokenizer: "code"` is rejected, and turning
on a code flag without the code analyzer is rejected. Passing a flag as
`false` is always allowed. The checks live in one helper used by both
`fts` and `tokenize`.
- The option docs state the defaults (`analyzer: "code"` alone keeps
identifiers whole; `splitOnNumerics` and `preserveOriginal` only matter
with `splitIdentifiers: true`) and link the two Lance limitations noted
on #4756 (lance#9674 and lance#9658).

Shared presets can still include extra fields. For example, a preset can
carry the index name for `createIndex()` alongside the analyzer options
used by `Index.fts()` and `tokenize()`.

## Tests

The Node tests check exact tokens from both the named index and
standalone tokenization, whole identifiers, subword matches, shared
presets and invalid combinations of known options. With the rebuilt
native addon, the full local Jest run passed 2,045 tests across 37
suites, with 27 tests skipped. TypeScript checks, lint and API reference
regeneration also passed.

---------

Co-authored-by: Xuanwo <github@xuanwo.io>
2026-12-01 20:58:15 +08:00
Olexandr88 a728692772 fix(namespace): create declared-only table on exist_ok create_table (#5329)
`create_table` with `CreateTableMode::ExistOk` treated any successful
`describe_table` as an existing table and tried to open it. A table that
was only declared in the namespace (no data on storage yet) failed with
`TableNotFound ... DatasetNotFound ... _versions`, while `Create` mode
already handles this case.

- Ask `describe_table` for `check_declared`, and only open the table
when `is_only_declared` is not true.
- Otherwise fall through to the normal create path, and handle a declare
conflict for `ExistOk` the same way as for `Create`.

Test: `test_namespace_create_table_exist_ok_after_declare_only` fails on
main with `TableNotFound { name: "declared_only", ... _versions }` and
passes with this change. The existing `exist_ok` tests are unchanged and
pass.

The race between `describe_table` and `declare_table` is unchanged by
this PR.
2026-12-01 20:55:51 +08:00
Lance Release 2cc9cdfac4 Bump version: 0.42.0-beta.38 → 0.43.0-beta.0 v0.43.0-beta.0 2026-12-01 12:43:00 +00:00
Yang Cen 155457d0e5 feat(query): allow unordered vector and full-text search results (#5328)
## Summary

Callers that consume every selected hit can relax the final output order
with `ordered_results(false)` in Rust, `ordered_results(False)` in
Python, or `orderedResults(false)` in TypeScript. Ranked output remains
the default. The option preserves top-k selection, each hit’s score and
projected columns, and the existing rules for ties at the cutoff.

Embedded passes eligible queries to the Lance scanner. Enterprise sends
`"ordered": false` for eligible searches and omits the field by default.
Explicit sorting, positive offsets, batch vector queries and inputs to
hybrid fusion or reranking keep their existing order.

## Validation

A managed Linux preview passed 8 Rust wire cases, 4 Embedded Python
cases, 10 HTTP mock cases and all 52 TypeScript query tests. The preview
used a candidate Lance revision. Project CI on this PR validates the
integration with the official Lance `v16.0.0-beta.6`.

Uses the official Lance dependency from #5327, now merged into `main`.
2026-12-01 20:41:37 +08:00
AsadullahMaliyawala 0da2b7b307 test(python): re-enable tests skipped on Windows that now pass (#5326)
Several Python tests are skipped on Windows, so the Windows CI job never
runs them. I ran them on Windows and they pass now, so this PR removes
the skips:

- `test_db.py`: the four `namespace_client` tests ("Namespace client
issues")
- `test_table.py`: `test_consistency` ("directory namespace is not
supported on Windows yet")
- `test_namespace_integration.py`:
`test_namespace_create_schema_only_with_provider`
- `docs/test_search.py`: the five FTS tests that pointed at
lancedb/lance#3905, which was closed in June 2025

Two of the `namespace_client` tests still failed on Windows, but only
because of how they checked the root. `namespace_id()` returns a Rust
debug string like `DirectoryNamespace { root: "C:\Users\..." }`, so the
backslashes are escaped and `str(tmp_path) in namespace_id()` was false.
The assertion now escapes them the same way first. On POSIX paths that
is a no-op, so the check is unchanged there.

No library code changes.

### Testing

On Windows 11, Python 3.12, with the `lancedb==0.42.1` wheel:

- The 17 re-enabled test cases pass. I ran them 6 times in a row and
they passed every time, including `test_consistency` with the 0.1 s
interval.
- Full suite (`-m "not slow and not s3_test"`): 4777 passed, 205
skipped, 0 failures.
- `ruff check` and `ruff format --check` pass.

I found this with help from Claude Code (Claude Opus 5.5) while running
the test suite on Windows. I checked each change and ran the tests
myself.
2026-12-01 19:21:41 +08:00
LanceDB Robot 1b7537c007 chore: update lance dependency to v16.0.0-beta.6 (#5327)
Bump the Rust and Java Lance dependencies to
[v16.0.0-beta.6](https://github.com/lance-format/lance/releases/tag/v16.0.0-beta.6)
and pin Python tests to pylance 16.0.0b6. Remove four redundant Rust
visibility modifiers flagged by strict Clippy.

The [Java publication
workflow](https://github.com/lance-format/lance/actions/runs/46611272196)
completed successfully. On December 1 at 10:20 UTC, both Maven artifact
URLs returned HTTP 200. The published POM declares
`org.lance:lance-core:16.0.0-beta.6`, and a range request to the JAR
returned its ZIP header.
[POM](https://maven.lance.org/org/lance/lance-core/16.0.0-beta.6/lance-core-16.0.0-beta.6.pom)
·
[JAR](https://maven.lance.org/org/lance/lance-core/16.0.0-beta.6/lance-core-16.0.0-beta.6.jar)
2026-12-01 18:49:08 +08:00
belovafandXuanwo bd37cb0cd1 feat(rust)!: expose vector query partition parallelism (#5054)
BREAKING CHANGE: Callers that initialize `VectorQueryRequest` with an
exhaustive struct literal must add `query_parallelism: None` to preserve
automatic scheduling.

Expose Lance's existing IVF partition-search concurrency control through
the Rust `VectorQuery::query_parallelism` builder. This lets callers
override the automatic sequential policy used by flat sub-indexes
without changing the probe budget or bypassing LanceDB's query API.

The setting is optional, so existing queries keep their behavior.
Accepted values match Lance: `0` for automatic selection, `-1` for the
CPU pool, `1` for sequential execution, and positive limits for
partition-parallel execution. Values below `-1` are rejected, including
requests constructed directly through public fields.

An ordinary Embedded IVF query applies the setting within each index
segment. Separate segments may run concurrently. If the selected plan
uses shared batch IVF, an explicit value returns `NotSupported` because
its scheduler controls its own load and scoring windows. Leaving it
unset preserves batch execution. Enterprise also returns `NotSupported`
before sending an explicitly configured query because its request
contract does not support this setting. Namespace queries with explicit
settings route locally. The existing ordering, scan-order and RTE checks
remain in effect.

The tests cover single-segment IVF values and result equivalence,
two-vector Embedded batch execution with the option unset and rejected
explicit settings, Enterprise default requests and rejection before HTTP
for explicit settings, direct invalid requests, and namespace/RTE
routing. The Rust API and vector-search guide document the per-segment
scope.

Lance already exposes this control (introduced in
https://github.com/lance-format/lance/pull/6475); this PR exposes it at
the LanceDB Rust layer.

---------

Co-authored-by: Xuanwo <github@xuanwo.io>
2026-12-01 18:30:56 +08:00
DogerW 2c094ac4e6 fix(node): accept shared and cross-realm ArrayBuffers in table updates (#5325)
`Table.update({ values })` accepts `ArrayBufferLike` in TypeScript, but
passing a `SharedArrayBuffer` to update a binary column throws
`Unsupported value type: object value: ([object SharedArrayBuffer])`. An
ordinary `ArrayBuffer` created in another Node.js VM context also fails
the serializer's `instanceof ArrayBuffer` check.

Use Node's `isAnyArrayBuffer` to recognize both kinds of buffer across
contexts, then pass their bytes through the existing SQL binary literal
encoder.

The table regression writes `00 80 ff` from shared memory and reads the
bytes back on each supported Arrow major (15–21). A separate serializer
test covers an `ArrayBuffer` from another VM context. All eight cases
failed before the fix.

### Validation

- Node 22 on macOS arm64, using the upstream native build from
`0d735c9`: both complete Jest files passed (701 passed, 3 skipped).
- Node SDK Biome checks and strict TypeScript checks for the serializer
and its unit tests passed. The full SDK type check reported the same ten
diagnostics on the base commit and patched tree with this local setup
(optional embedding packages and older native reranker declarations).
2026-12-01 18:24:19 +08:00
Tomwang.ethandtomwangcn 76c8bf335a fix: expose branch create_at and metadata in branches.list() for node and python (#4914)
Fixes #4849.

**Problem**
- TypeScript SDK: `Branches.list()` returned napi class instances whose
fields live on the prototype, so `console.log`, spread and
`JSON.stringify` showed `{}` (the exact symptom in the docs example).
`create_at` and `metadata`, which Lance already stores for every branch,
were not exposed at all.
- Python SDK: the `Branches.list()` dicts also dropped `create_at` and
`metadata`.

**Change**
- `nodejs/src/table.rs`: `BranchContents` stays a runtime napi class
export and gains `create_at` (Unix seconds) and `metadata`, populated
from the stored Lance branch contents. The `metadata` getter defines
every key as an own enumerable data property (`napi_define_properties`),
so keys like `__proto__` that ordinary map conversion would route to the
prototype setter are preserved.
- `nodejs/lancedb/table.ts`: the `Branches.list()` wrapper promotes all
fields (`parentBranch`, `parentVersion`, `createAt`, `manifestSize`,
`metadata`) to own enumerable properties on each returned instance by
reusing the class getters and setters, so spread and `JSON.stringify`
see them while `instanceof` keeps working. Its return type is
`ListedBranchContents`, which guarantees `createAt` and `metadata`.
- Public typing: the exported `BranchContents` type keeps its released
shape (`parentBranch`/`parentVersion`/`manifestSize` only), so values
and interfaces written against it stay assignable and extendable,
including a view whose `createAt` is a `Date` and an interface that
extends `BranchContents` with its own `metadata`. `ListedBranchContents
extends BranchContents` adds `createAt` and `metadata` as required
fields, and the exported `BranchContents` constructor value has its
`prototype` typed as `BranchContents`, so the class value and
`instanceof` checks are unchanged.
- `python/src/table.rs`: `Branches.list()` dicts now include `create_at`
and `metadata`.
- Docs: regenerated TypeScript API reference for the new shape, and the
branching guide now documents `createAt`/`create_at` (Unix seconds) and
`metadata`.

**Tests**
- `nodejs/__test__/table.test.ts`: a branch whose stored ref file
carries non-empty metadata (including a `__proto__` key) and a known
creation time in Unix seconds is listed with both, as a `BranchContents`
instance with own enumerable fields, surviving spread and a JSON
round-trip with every metadata key intact. A second test covers the
consumer type contracts with `tsc`: a released-shape value with an extra
`createAt: Date` stays assignable to `BranchContents`, an interface
extending `BranchContents` can declare its own `metadata` shape, the
exported constructor's `prototype` is typed as `BranchContents`, and
`branches.list()` results guarantee `createAt` and `metadata`.
- `python/python/tests/test_table.py::test_branches`: same
non-empty-metadata (with `__proto__`) and known-`create_at` coverage.
- Verified locally on Linux x86_64: `tsc -b`, Biome checks, regenerated
docs diff limited to the `BranchContents` pages, node branches suite (34
passed), python `test_branches` (4 passed, 1 skipped).

---------

Co-authored-by: tomwangcn <tomwangcn@users.noreply.github.com>
2026-12-01 17:29:44 +08:00
KeeProMiseandXuanwo a85cb92ffd feat: support vector-only and FTS-only reranking (#3024)
Add rerank_vector() and rerank_fts() methods to Reranker trait, allowing
rerankers to work with single search modes instead of only hybrid
search.

Implemented for:
- RRFReranker (Rust and Python)
- LinearCombinationReranker (Python)

Resolves TODO at rust/lancedb/src/rerankers.rs:55

Changes:
- Extended Reranker trait with default implementations
- Added unit tests for new methods
- Updated documentation with examples

---------

Co-authored-by: Xuanwo <github@xuanwo.io>
2026-12-01 17:07:02 +08:00
WilliamandXuanwo 22ed284031 fix(namespace): validate schema and invoke callback on exist_ok create_table (#5240)
LanceNamespaceDatabase::create_table previously ignored the
OpenTableRequest callback and bypassed schema validation when
CreateTableMode::ExistOk matched an existing table.

- Invoke (callback)(OpenTableRequest) and open via self.open_table(req)
so caller-supplied namespace open options (name, namespace_path,
lance_read_params) are applied.
- Compare the existing table schema against the incoming schema using
lance_core::datatypes::Schema persistence rules (compare_with_options)
and return Error::Schema ("Provided schema does not match existing table
schema") on mismatch.
- Add unit tests in database::namespace::tests covering
callback-selected table opening, FixedSizeList persistence
compatibility, and mismatched schemas for both create_table and
create_empty_table.

Closes https://github.com/lancedb/lancedb/issues/5123

---------

Co-authored-by: Xuanwo <github@xuanwo.io>
2026-12-01 16:36:41 +08:00
DogerW 34e33ecf64 fix(python): preserve Arrow values when merging hybrid reranker scores (#5323)
An Embedded hybrid query using `RRFReranker(return_score="all")` can
change unrelated result columns. On 0.42.1, a `time64[ns]` value of 1001
ns comes back as 1000 ns with pandas installed. A fixed-shape tensor
created with `FixedShapeTensorArray.from_numpy_ndarray` raises
`NotImplementedError` during the same query. Both columns round-trip
with the default relevance score.

The shared reranker merge converts every result row to a Python object
to combine `_distance` and `_score`. This change looks up row positions
by `_rowid` and takes rows and scores directly from the Arrow columns. A
hit in both searches keeps the vector row and receives the FTS score.
The regression tests run a hybrid search against an in-memory table and
compare the returned Arrow arrays with the inputs.

### Testing

- Both new cases failed before the change and passed after it. Also
verified the fix with pandas uninstalled.
- The two new cases and both existing rank-fusion score tests also
passed with the minimum supported PyArrow 16.0.0.
- Ran the checkout's rerankers with the 0.42.1 SDK and native extension.
`test_rerankers.py` and `test_typesafe_reranker.py` had 158 passes and
17 skips. Including `test_hybrid_query.py` gave 187 passes and 17 skips,
with the same 14 failures seen before this change against the release
SDK.
- Python Ruff checks and formatting for both changed files passed.
2026-12-01 16:24:46 +08:00
out13andXuanwo 1e37e8aa0c fix: compile lancedb without the remote feature (#4892)
## Problem

`cargo clippy --workspace --tests` without the `remote` feature fails
under
`-D warnings`: a handful of items are reachable only from `remote`-gated
modules (or only from tests), so a local-only build reports them as dead
code
and unused imports. `cargo check -p lancedb --no-default-features`
reports the
same warnings.

## Fix

Gate the remote-only and test-only code behind its feature:

- `job.rs`: `TerminalResult::{remote, value, with_value}`, `Job::new`,
and the
  in-process query-task constructors (`from_query_task`,
`new_with_cancellation`), which only remote SQL jobs and the job unit
tests
  use, plus the `Uuid` import they need.
- `materialized_view.rs`: `RefreshMaterializedViewOptions::sql_clause`,
used
  only to build the remote refresh request.
- `query.rs`: `AnalyzePlanDistributedMetrics::as_query_param`.
- `query/wal_fusion.rs`: the PK-fusion refusal memory (`PkFusionMemory`,
  `MEMORY_TTL`) and its `Mutex`, `Duration`, and `Instant` imports.
- `table/computed_columns.rs`: the Function declaration planner and its
  target/plan types (`FunctionApplication`, `FunctionOutputTarget`,
  `FunctionInputTarget`, `FunctionDeclarationPlan`,
  `function_input_nullability`, `plan_function_application`).
- `table/rte_stats.rs`: `GetRTEStatsResponse`.
- `utils`: `resolve_arrow_fts_field_path`.

The `TerminalResult::decode` E0599 half this branch originally fixed
(constructing `Error::Http` without `remote`) has since landed on `main`
separately (#4103, #4233), so the rebase drops that change and keeps
only the
remaining gating.

## Verification

- `cargo check -p lancedb --no-default-features`
- `cargo check -p lancedb --features remote`
- `cargo clippy -p lancedb --tests --no-default-features -- -D warnings`
- `cargo clippy --workspace --tests -- -D warnings`
- `cargo fmt --all -- --check`


[![](https://img.shields.io/badge/powered_by-dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white)](https://github.com/deepseek-ai/deepseek-harness)

Co-authored-by: Xuanwo <github@xuanwo.io>
2026-12-01 16:18:03 +08:00
dayan02devandXuanwo 0d735c9c46 fix: accept Lance-normalized schemas when reopening a table with exist_ok (#5036)
## Why
Lance stores a fixed-size list of a primitive type without its child
field and reads the child back as a nullable `item`. It also stores
`Utf8View`/`BinaryView` as `Utf8`/`Binary`. A schema such as
`DataType::new_fixed_size_list(DataType::Float32, n, false)` therefore
never equals the stored schema. In Python, Rust and TypeScript,
`exist_ok` fails with "Provided schema does not match existing table
schema" on every run after the first.

Part of #2570. This fixes reopening an existing table with `exist_ok`
and the original schema. The first create still normalizes the child
field, so `table.schema()` returns Lance's schema and the issue's
`assert_eq!(table.schema(), schema)` still differs.

## What changed
- `ListingDatabase::handle_table_exists` keeps the exact comparison. It
also accepts a provided schema that converts through
`lance::datatypes::Schema` to the table's schema, which is the same
conversion `NativeTable::schema` uses. A schema Lance can't convert
still returns `Error::Schema`.
- The reopen now passes the create request's `location` into
`OpenTableRequest` before the `exist_ok` callback runs. It used to open
the default location, so `create_table(..., exist_ok, location)` could
return a different table with the same name.
- Out of scope: the remote client's `exist_ok` fallback (`remote/db.rs`)
has the same strict `!=`. Whether it triggers depends on what the
server's describe returns, so I left it unchanged.

## Verification
- `test_create_table_exist_ok_with_lance_normalized_type` covers an FSL
with a non-null child, an FSL whose child is named `element`, and
`Utf8View`. A real difference (top-level nullability) still fails with
`Error::Schema`.
- `test_create_table_exist_ok_opens_requested_location` puts `id=10` at
the default location and `id=20` at an explicit one. With the original
and with the normalized schema, `exist_ok` with the explicit location
must return that URI and read back `id=20`.
- Each test fails without its fix and passes with it. `cargo test -p
lancedb --lib` (2383 passed), `cargo clippy -p lancedb --tests -- -D
warnings`, `cargo fmt --check` and typos are clean. The Python bindings
are unchanged, and `python/tests/test_db.py` was not run locally.

---------

Co-authored-by: Xuanwo <github@xuanwo.io>
2026-12-01 16:05:44 +08:00
4e4ae3eb19 fix(python): preserve NumPy timedelta units in table updates (#5317)
Fixes #5316.

Writing `np.timedelta64(3_000_000, "ns")` to a millisecond duration
column succeeds but stores 3,000,000 ms. NumPy duration scalars also
match the integer serializer, which drops the unit before the update
reaches Arrow.

Give `np.timedelta64` its own serializer. It reads the dtype's unit and
multiplier, then reuses the Arrow duration serializer. Weeks through
minutes are expressed in seconds. Calendar and sub-nanosecond units
raise a conversion error, and `NaT` writes a null.

The regression tests read back Arrow's integer counts to check
cross-unit writes, exact nanoseconds, a negative value with a scaled
dtype, and nulls. They also check that rejected inputs leave the stored
value intact.

### Validation

- Reproduced the incorrect stored value on the published 0.42.1 Python
SDK.
- Ran the checkout's converter with the 0.42.1 SDK and native extension.
Before the fix, seven of the eight new regression cases failed. After
the fix, all 74 update-value tests and 24 related SQL conversion and
update tests passed. Also verified four asynchronous updates against an
Embedded table.
- Ruff lint and formatting checks passed for the Python SDK.

The overflow check and additional NumPy duration conversion tests come
from #5319.

Co-authored-by: tonydzi <194927794+tonydzi@users.noreply.github.com>

---------

Co-authored-by: Xuanwo <github@xuanwo.io>
Co-authored-by: tonydzi <194927794+tonydzi@users.noreply.github.com>
2026-12-01 15:26:46 +08:00
Xuanwo 9cd5b95a00 test(rust): stabilize presigned reads after an idle connection reset (#5304)
The idle connection reset test disables connection retries. On macOS 26,
the next range GET can write to the stale socket before the HTTP pool
observes the reset and return `BrokenPipe`. This fails on `main` and on
PRs that inherit the test.
[Main](https://github.com/lancedb/lancedb/actions/runs/46342154434/job/141596071384)
·
[#4892](https://github.com/lancedb/lancedb/actions/runs/46139288217/job/141879753179)
·
[#5240](https://github.com/lancedb/lancedb/actions/runs/46069428496/job/140757758471)

Allow one connection retry in the test so the read can recover through
the existing presigned GET path. The server still verifies reuse of the
initial socket and a successful read on a fresh socket. The requests
must retain the signed URL and range and omit the Enterprise API key.
The adjacent disconnect tests cover both enabled and disabled connection
retries.
2026-12-01 14:18:54 +08:00
Xuanwo e7563e7f93 test(rust): stabilize deferred SQL timeout cancellation (#5305)
The deferred-result timeout regression intermittently fails in the macOS
SDK SQL job. The test pauses Tokio while opening a loopback DoGet, so
the SDK deadline and the gRPC request timer can compete to finish the
read. [Failure on
main](https://github.com/lancedb/lancedb/actions/runs/46420851203/job/141855322793)

Delay result-request headers so the SDK deadline expires before DoGet
starts. The regression checks that the pending reader returns the
overall timeout and that the Flight server receives cancellation. The
timeout assertion also reports the unexpected result on failure.
2026-12-01 14:08:51 +08:00
lipeh1andlipeih 45718a938c test(node): speed up Jest transforms with SWC (#5182)
Jest now uses SWC to transpile the Node SDK tests, with the same ES2022
target and legacy decorator semantics as the SDK. The Node and Arrow
compatibility jobs run the existing test TypeScript project through `tsc
--noEmit` after building the SDK. Contributors can run that check with
`pnpm run typecheck:tests`.

Closes #2234.

Measured on Windows x64 with Node 22.23.4, Jest 29.7, the default native
features and one Jest process (`--runInBand --silent`). Both runs used
the same 0.42.0-beta.26 Windows native binary. Times below are
wall-clock seconds.

| Workload | ts-jest | SWC |
| --- | ---: | ---: |
| Six suites, empty Jest cache (median of three) | 8.31 | 4.22 |
| Same six suites, populated cache (median of three) | 4.45 | 3.52 |
| Full default suite, empty Jest cache (one run each) | 50.10 | 38.55 |

The six suites were `arrow`, `expr`, `materialized_view`, `package`,
`registry` and `sanitize`. Each pair started with a fresh Jest cache
directory and immediately reused it on the second run. The separate test
type check took 3.39 s, bringing the full SWC run plus type checking to
41.94 s on this machine.

Both full runs passed the same 1,882 tests with 28 skipped. The SDK
TypeScript build, test type check, Biome checks and TypeDoc build also
passed.

---------

Co-authored-by: lipeih <lipeihan@eazytec.com>
2026-12-01 14:04:35 +08:00
Xuanwo 4e7d5c0d1a fix(node): link standalone Rust tests without Node (#5321)
The Node binding's Rust tests construct and drop `napi::Error`. Its
cleanup code references Node-API symbols, which Node supplies when it
loads the addon. Standalone Rust test executables have no Node host, so
`lancedb-nodejs` fails at link time. [Linux
`build-no-lock`](https://github.com/lancedb/lancedb/actions/runs/46573309068/job/142389591633)
· [macOS 15 `--locked` test
job](https://github.com/lancedb/lancedb/actions/runs/46574143498/job/142392302720)

Enable napi-rs `dyn-symbols` through the dev dependency. Cargo activates
it when building the existing Rust tests and uses the original linkage
for ordinary addon builds.

On `08911d637`, deleting `Cargo.lock` and running `cargo +stable build
--profile ci --all-features --tests -p lancedb-nodejs --jobs 2`
reproduced the three missing symbols. With the same freshly resolved
dependencies, `cargo +stable test --profile ci --all-features --tests -p
lancedb-nodejs --jobs 2` linked and passed all 10 tests, including the
cause chain and resource metadata assertions.

---------

Signed-off-by: Xuanwo <github@xuanwo.io>
2026-12-01 13:16:02 +08:00
Alex Shen 08911d6378 docs: import LanceDB in the NVIDIA example (#5320)
## Summary

The first Python example in the NVIDIA Nemotron guide calls
`lancedb.connect` without importing `lancedb`. Import the module so
readers can run the example in a fresh Python session.

## Test plan

- Ran the first fenced Python example from the guide in a fresh
namespace. The original raised `NameError` at the connection call.
- Reran the changed example with SDK stubs. It reached table creation,
insert, and search without calling a live NVIDIA endpoint.
- Checked that the diff changes only the import.

AI assistance disclosure. OpenAI Codex helped prepare and verify this
documentation change.
2026-12-01 12:06:08 +08:00
somil jainandXuanwo bb8e83e69a feat(fts): add WAND factor support for FTS and hybrid search (#4894)
Fixes #4754

Add wand_factor support across synchronous and asynchronous FTS and
hybrid query APIs, with finite non-negative value validation, PyO3
propagation, query serialization support, and namespace execution
fallback when a custom factor is configured. Add tests covering default
behavior, custom values, validation, clearing the factor, sync/async
execution, serialization round-trips, and namespace routing.

---------

Co-authored-by: Xuanwo <github@xuanwo.io>
2026-12-01 12:05:10 +08:00
yuzhouandXuanwo b3ad97a28d feat(node): surface Rust errors as typed JavaScript errors (#4901)
## Summary
The Node SDK now throws typed `LanceError` subclasses instead of one
generic `Error` with an indented `Caused by` string.

Fixes #222

## Before / after
```ts
try {
  await db.openTable(\"missing\");
} catch (error) {
  if (error instanceof TableNotFoundError) {
    error.code;       // \"TableNotFound\"
    error.tableName;  // \"missing\"
    error.message;    // \"Table 'missing' was not found\"
    error.cause;      // underlying dataset error
  }
}
```

## Changes
- `nodejs/src/error.rs` — map each `lancedb::Error` variant to a
one-line header + `error.cause`
- `nodejs/src/query.rs`, `nodejs/src/merge.rs` — pass errors through
instead of stringifying
- `nodejs/lancedb/errors.ts`, `errors_install.ts` — real subclasses when
the package loads
- Tests + generated API docs under `docs/src/js/`

## Test plan
- [x] Native debug build, `tsc`, Biome, `cargo clippy -p lancedb-nodejs`
- [x] Jest: new error tests, remote retry, connection/query/table (594
passed)

## Notes
Node-API cannot construct a custom `Error` subclass from an async Rust
rejection, so translation happens in JS when `@lancedb/lancedb` loads.
Calling the raw native addon without that entrypoint still shows the
header line.

---------

Signed-off-by: ZYZ666-RGB <1991039819@qq.com>
Signed-off-by: yuzhou <1991039819@qq.com>
Co-authored-by: Xuanwo <github@xuanwo.io>
2026-12-01 11:28:22 +08:00
071c220713 docs: clarify embedding comparisons in time-travel RAG (#5318)
## Summary

Clarify what the Time-Travel RAG example demonstrates. It retrieves
different top documents with two embedding models. Distances are
measured within each model's embedding space. The text now gives readers
a way to evaluate relevance with the same queries and labeled judgments,
and links to the current embedding guide outside the terminal excerpt.

## Validation

Checked that the revised excerpt preserves the two recorded results and
that `/embedding` resolves to the embedding guide. A small Euclidean
example confirmed that rescaling embeddings can change distances while
preserving the ranking. The diff check passed. Validation covered the
tutorial text, link, and numeric example.

AI disclosure — OpenAI Codex checked the upstream recipe and
documentation, edited the tutorial, and validated the example and link.

Co-authored-by: AlexShen-Oguri <176059206+AlexShen-Oguri@users.noreply.github.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
2026-12-01 11:06:05 +08:00
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
Xuanwo cf8f36cf06 fix(ci): retry Java releases from existing tags (#5315)
Add manual dispatch for Java publication after the original GitHub
Actions rerun window expires. The workflow resolves the supplied tag,
verifies the Maven parent and core versions, and shares the existing
signing and deploy steps with tag-triggered runs. Stable tags use Maven
Central and beta tags use Fury.
2026-12-01 09:16:48 +08:00
Bruno Ramirez b29666cbc2 ci(cli): start PyPI publishing after stable CLI releases (#5313)
Publishing `lancedb-tools` currently requires a maintainer to dispatch
the wheel workflow after each stable CLI release. This PR starts the
workflow on `main` when the GitHub release run finishes and its
asset-publication job succeeded for that tag. This also covers tags cut
from existing release branches. The `release` team still approves the
PyPI upload after the three native install checks pass.

This was accomplished with the following changes:

- Pass the originating release tag to the build, install checks, and
upload job.
- Check the `gh-release` job in the triggering attempt so a Homebrew
failure can’t block packaging and a Homebrew-only retry won’t rebuild
wheels.
- Keep manual dispatch available for recovery and document it in the
release guide.
2026-11-30 15:14:49 -08:00
Xuanwo ca4c2ae5de docs: document streaming Blob outputs for Functions (#5307)
The Function guides still hide their `BlobWriter` guidance. LanceDB
Enterprise 1.16.0 ships the server and worker support for computed
column refresh, and the paired Python SDK `0.42.0b38` includes #5171.
Show how to register a writer-based Function with that release pair and
when to keep returning `bytes`.

Both pages were rendered locally before and after the change. The
updated HTML includes the release pair, writer annotations, and plain
SQL `SELECT` fallback.

For the release pairing, we checked that the Enterprise 1.16.0 release
commit contains the server and worker implementation and that the image
digests promoted for release match the qualified bundle. We also
compared `functions.py` and `_blob_writer.py` in the released Linux
wheel with their tagged sources. Both files matched byte for byte. [SDK
release
source](https://github.com/lancedb/lancedb/tree/v0.42.0-beta.38/python/python/lancedb)
2026-12-01 01:46:08 +08:00
Bruno Ramirez 035acd8395 feat(cli): publish stable CLI wheels to PyPI with manual approval (#5215)
The CLI workflow added in #5214 builds and tests `lancedb-tools` wheels,
but release maintainers still need a way to publish them to PyPI. This
adds an opt-in upload for published stable releases. A maintainer starts
the workflow from `main` with the release tag, then a required reviewer
approves the upload after the native install tests pass.

This was accomplished with the following changes:

- Check the GitHub release and the required reviewer configuration on
`pypi-cli` before requesting deployment.
- Use PyPI Trusted Publishing to upload the three tested wheels from the
same run and verify their public SHA-256 digests. A retry can finish a
partial upload.
- Document the dispatch command and the one-time GitHub environment and
PyPI publisher setup.

### Testing

Added tests for a published stable release, mismatched and beta tags,
draft or missing releases, and missing reviewer protection. PR runs also
exercise the beta wheels with `uvx` and `pipx` across all three
supported platforms. The first production upload requires the configured
publisher and an approved stable release.
2026-11-30 08:45:30 -08:00
Yang Cen af23585259 docs(sql): clarify JSON scalar index eligibility (#5306)
The JSON function reference promises index acceleration for every
accessor. Document the key and type requirements for typed lookups,
explain serialized ordering for `json_extract`, and link to `EXPLAIN` so
readers can check their plan.

Checked the examples against LanceDB's pinned Lance implementation and
verified the documentation link and `git diff --check`.

Related to lance-format/lance#8806.
2026-12-01 00:35:43 +08:00
Lenin MookiahandLenin Mookiah 7509718f02 fix(python): create an empty table when a vector column has no rows to infer from (#5205)
This PR fixes [issue
#5204](https://github.com/lancedb/lancedb/issues/5204).

Fixes #5204

`create_table(name, data=...)` hung forever when `data` was an Arrow
table with zero rows and a variable-length list column named like a
vector (`vector`, `embedding`).

With no `schema=`, `_infer_target_schema` peeks the first batch to infer
the vector dimension. On a reader with no batches, `peek_reader` raises
`StopIteration`. That happens inside `asyncio.to_thread`, where a
`StopIteration` can't be set on the Future, so `create_table` never
returned.

With no rows the dimension can't be inferred, the same case as an
all-null vector column, which already keeps the variable-length list. So
`_infer_target_schema` now returns the input schema unchanged when the
reader has no batches.

## Testing

`test_infer_target_schema_empty_reader` covers `list<float32>` `vector`,
`large_list<float64>` `embedding` and `list<int32>` `vector`. All three
fail on main with `StopIteration` and pass with the fix.

```
pytest python/tests/test_util.py                      # 142 passed, 1 skipped
pytest python/tests/test_table.py python/tests/test_db.py -m "not slow and not s3_test"   # 636 passed, 17 skipped
pre-commit run --files <changed files>                # ruff, typos, whitespace: passed
```

I ran these with main's `python/` over the extension from the 0.42.0b26
wheel, since I don't have a Rust toolchain here, and with pylance 14.0.3
because the pinned 15.0.0b35 wasn't on the indexes I could reach. With
the fix, the reproduction from the issue creates the table: 0 rows,
`vector: list<item: float>`.

The Node.js SDK has no equivalent peek on empty input (its empty-data
path requires a schema), so no change there.

---------

Co-authored-by: Lenin Mookiah <2639584+leninworld@users.noreply.github.com>
2026-11-30 23:34:27 +08:00
Alex Castillo González 6907440bc1 fix(python): split Cohere embedding requests into batches of 96 (#4834)
Fixes a failure when adding 97 or more rows with a Cohere embedding
function on SDK releases that do not batch.

**Cause:** `CohereEmbeddingFunction.generate_embeddings` sends all texts
to `client.embed`. Cohere's endpoint accepts at most 96 texts per call,
and some releases (for example 5.0.0 to 5.1.2) send them as a single
request.

**Fix:** clients that batch on their own (4.x, and releases whose
`embed` takes `batching`) get the full input, which keeps their
concurrent requests. Other clients get chunks of 96, concatenated in
order.

**Test:** one test uses a client without batching and checks calls of
96/96/8. A second runs the installed SDK against a local transport and
checks request sizes, order and concurrency where the SDK supports it.

---
Disclosure: this change was prepared with AI assistance (Claude Code).

---------
2026-11-30 23:11:52 +08:00
prassu017 c678b6ee02 chore(deny): drop advisory ignores the lockfile no longer needs (#5110)
The lockfile already has patched versions of zip (9.2.2), pyo3 (0.29.3)
and crypto-bigint (0.7.10), so the six ignore entries for their
advisories no longer suppress anything. This removes them so a future
downgrade would be reported again.

Closes #5109

Checked by comparing both `Cargo.lock` files on main (4ac2728) against
the patched ranges in the RustSec advisory files; the remaining ignore
list still parses. I did not run `cargo deny check` locally.
2026-11-30 23:08:10 +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
Juampi 0ba8b6f0a8 docs: add Firecrawl integration page (#4706)
I work at Firecrawl. This adds a Firecrawl page to Integrations > Data
Platforms & Frameworks: a Python recipe that crawls a site with
Firecrawl, stores the pages as Markdown chunks with their source URL in
a LanceDB table that embeds them through the embedding registry,
searches the table, and then adds web search results to the same table.

It follows the docs workflow in CONTRIBUTING.md:

- The example is a test, `docs/web-tests/py/test_firecrawl.py`, split
into five `--8<--` snippets. Like the other integration snippets that
need a provider key, it skips unless `FIRECRAWL_API_KEY` is set.
- `docs/web/snippets/firecrawl.mdx` is generated from it with `uv run
docs/web-tests/mdx_snippets_gen.py -s docs/web-tests/py -s
docs/web-tests/ts -s docs/web-tests/rs -o docs/web/snippets`. The
generator also rewrites other snippet files on current `main` without
this change, so I left those out.
- `docs/web/integrations/data/firecrawl.mdx` imports the snippets with
`<CodeBlock>` like the dlt page, and every heading has an explicit
`{#anchor}`.
- `docs/web/docs.json` adds the page at the end of the Data Platforms &
Frameworks group.

The embedding function is `sentence-transformers` with
`all-MiniLM-L6-v2`, so the recipe needs no API key besides Firecrawl's.
Each Firecrawl call passes `integration="_lancedb"`, a label that tells
Firecrawl a request came from this guide; the page says it is optional.
It needs `firecrawl-py` 4.3.3 or later.

## Testing

```
$ FIRECRAWL_API_KEY=... pytest docs/web-tests/py/test_firecrawl.py -v
test_firecrawl.py::test_firecrawl_crawl_and_search PASSED     (lancedb 0.40.0, Python 3.12)
$ pytest docs/web-tests/py/test_firecrawl.py -rs              (no key)
SKIPPED [1] Set FIRECRAWL_API_KEY to run this integration snippet
$ ruff format --check docs/web-tests/py/test_firecrawl.py && ruff check docs/web-tests/py/test_firecrawl.py
1 file already formatted
All checks passed!
```

Regenerating the snippets from the test produces the same
`docs/web/snippets/firecrawl.mdx`. I have not run the Mintlify site
checks (`mint validate`, broken-links), so please run them in CI or on
your side.

I drafted this with an AI coding assistant and ran the test above
myself.
2026-11-30 21:13:16 +08:00
Haocheng LiuandHaocheng Liu 80582fb87d docs: fix training and dedupe examples (#4932)
## Summary

- Save per-rank dataset checkpoints to separate files and load the
matching file when resuming.
- Add the missing LanceDB import to the data loader example.
- Correct the count of distinct rows in the deduplication example.

## Validation

- `git diff --check`
- Parsed the Python snippets in the affected training pages with
`ast.parse`.

---------

Co-authored-by: Haocheng Liu <haocheng.liu@general-int.com>
2026-11-30 21:09:38 +08:00
David Turner c9faa78cc6 feat(python): add free-threaded CPython 3.15 wheel support (#4961)
## Problem

The existing `cp310-abi3` wheel cannot be installed on free-threaded
CPython 3.15.

## Changes

- Keep `abi3-py310` in the default Cargo feature set and provide a
separate native free-threaded build profile with the same Python
distribution features.
- Build and validate `cp315-cp315t` release wheels for Linux x86-64 and
ARM64, macOS ARM64, and Windows x64; collect them with the existing
release artifacts.
- Add a Linux 3.15t CI job and tests for GIL state, concurrent
operations, and persistence. The existing regular-Python jobs retain the
full test suite.
- Validate compressed manylinux platform tags against the expanded
`WHEEL` metadata and use workspace-relative wheel paths in Python CI.

## Validation

- Built and validated Windows x64
`lancedb-0.42.0b10-cp310-abi3-win_amd64.whl` and
`lancedb-0.42.0b10-cp315-cp315t-win_amd64.whl` with Maturin 1.15.0 and
`--profile ci`.
- On the current PR commit `eecf193`, rebuilt the Windows x64 native
wheel, installed it on official CPython 3.15.0t, and ran `python -m
pytest python/python/tests/test_free_threaded.py -q`: 2 passed,
including GIL state and concurrent database operations.
- On the current PR commit, built a native Linux x86-64 `cp315-cp315t`
wheel with Maturin 1.15.0 and `--profile ci`, validated its wheel
metadata, installed it on CPython 3.15.2t, and ran `python -m pytest
python/tests/test_free_threaded.py -q`: 2 passed. This local Linux wheel
uses the native `linux_x86_64` platform tag, not a manylinux tag.
- Cargo feature regression check, Ruff, Python syntax, workflow YAML
parsing, and `git diff --check` passed.
- `python -m unittest discover -s ci/tests -p test_check_python_wheel.py
-v`: 4 passed on Windows and WSL Linux, including compressed manylinux
tags and mismatched metadata. The workflow's corrected wheel glob was
also checked from the `python` directory under WSL, and the two
free-threaded runtime tests passed from that directory on Windows.

The local ABI3 regression wheel was built before the rebase. The native
Windows and Linux free-threaded wheels and concurrency tests were built
from the current PR commit `eecf193`. The macOS and Linux manylinux
release artifacts still need validation in upstream CI. The full test
extra pulls optional dependencies requiring source builds on 3.15t, so
the new job installs the wheel and focused test dependencies; regular
jobs still run the full suite.

The complete CI-script suite passed locally on WSL Linux at commit
`eecf193`: `python3 -m unittest discover -s ci/tests -v` ran 39 tests
successfully with Rust 1.97, a user-space GCC toolchain, and Python's
`packaging` module. The upstream CI-script run is marked
`action_required`.

Closes #4641
2026-11-30 21:07:25 +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
Sudhir Vissa 97c88659f4 fix(python)!: fetch minimum rank-fusion window per side in hybrid search (#4772)
BREAKING CHANGE: Executing or analyzing an async Python hybrid query
with `limit(0)` now raises `ValueError` before either search runs. In
0.41.0, `offset(2).limit(0).to_arrow()` returned a typed empty table
after retrieval and reranking. Skip query execution and `analyze_plan()`
when the requested page size is zero.

Refs #4758

## Problem
Each side of a hybrid query fetched only `limit + offset` rows before
rank fusion, so asking for fewer results could return a different top
result instead of just a shorter list.

Repro (lancedb 0.41.0, 300 rows, RRF reranker):
- `limit=1` -> top id 294
- `limit=10` -> top id 269

## Fix
With the default RRF reranker, both hybrid paths
(`LanceHybridQueryBuilder._create_query_builders` and
`AsyncHybridQuery._create_child_queries`) now fetch `max(limit + offset,
DEFAULT_HYBRID_RANK_WINDOW)` rows per side, with
`DEFAULT_HYBRID_RANK_WINDOW = 50`. The requested limit/offset window is
still sliced out of the fused results as before. This implements option
1 from the issue: a fixed minimum window, no new API surface.

Custom and model rerankers keep the caller's `limit + offset` budget per
side, since every candidate is sent to them (for example
`OpenaiReranker` puts all merged texts in one prompt). Callers who want
a wider window for those rerankers can raise `limit()`. An explicit
`limit(0)` never gets the floor. In the async builder it raises
`ValueError` before schema discovery or either sub-query runs, with or
without an offset, so neither Embedded nor Enterprise retrieves or
scores anything. On main, async `limit(0)` was rejected by the native
`k` check only without an offset; `offset(2).limit(0)` fetched and
reranked two rows per side and returned nothing. The sync builder still
treats `limit(0)` as the default of 10, as before.

Trade-off: default RRF queries with small limits now fetch up to 50 rows
per side, and their result orderings can change, which is the bug being
fixed.

## Tests
- `test_hybrid_query_top_result_stable_across_limits` and its async
mirror (issue repro): fail on base, pass with the fix
- `test_hybrid_query_custom_reranker_keeps_candidate_budget` and its
async mirror: a recording reranker receives 1 vector and 1 FTS candidate
for `limit(1)` and 5 of each for `offset(2).limit(3)`
- `test_async_hybrid_query_default_rrf_candidate_window`: default RRF
receives 50 of each for `limit(1)`
- `test_async_hybrid_query_empty_page_does_not_fetch_candidates` (offset
0 and 2): `limit(0)` raises, and neither sub-query nor the reranker runs
- `test_remote_db.py::test_async_hybrid_zero_limit_sends_no_query`
(offset 0 and 2): `limit(0)` raises and no `/query/` request is sent;
fails on 281fdc7, passes on this head
- `test_remote_db.py::test_query_sync_hybrid` now expects `k=50` for the
default RRF request with `limit(42)`
- `test_hybrid_query.py`: 30 passed, 1 failed. The failure is
pre-existing and unrelated
(`test_hybrid_query_with_stale_fixed_size_binary_prefilter` needs the
`lance` package)
- `test_wal_hybrid.py`: 15 passed
- `ruff check` and `ruff format --check` clean on the touched files

Local runs used the lancedb 0.41.0 wheel with this PR's `query.py` diff
applied, since main needs a newer native extension than the published
wheel. `test_query_sync_hybrid` and the new remote zero-limit test were
run from an extracted copy because `test_remote_db.py` imports
`lancedb.graph`, which 0.41.0 does not have.

---------

Signed-off-by: shadowmodder <sudhirvissa@gmail.com>
Signed-off-by: Sudhir Vissa <sudhirvissa@gmail.com>
2026-11-30 20:42:12 +08:00
Ömer 83af5dec3e fix(python): pass gemini-text retrieval_document title via EmbedContentConfig (#5239)
Fixes #5235

### Summary
Restores the pre-#3250 Gemini `RETRIEVAL_DOCUMENT` request format by
passing `title` via `types.EmbedContentConfig(title=...)` rather than
prepending `{"text": "Embedding of a document"}` as a content part in
`contents`.

### Problem
When `GeminiText` migrated to `google-genai` in #3250, `"Embedding of a
document"` was placed inside `contents` as an extra `Part` (`{"parts":
[{"text": "Embedding of a document"}, {"text": text}]}`). That embeds
the literal placeholder phrase into every stored document vector while
`retrieval_query` embeds only the query text, creating asymmetric
representations.

### Changes
- **`python/python/lancedb/embeddings/gemini_text.py`:** Always send
`{"parts": [{"text": text}]}` in `contents`, and set
`config_kwargs["title"] = kwargs.get("title", "Embedding of a
document")` on `types.EmbedContentConfig` when `task_type.lower() ==
"retrieval_document"`.
- **`python/python/tests/test_gemini.py`:** Updated
`test_generate_embeddings_retrieval_document` to verify `contents` holds
only the document text while `EmbedContentConfig` receives
`title="Embedding of a document"`, and added
`test_generate_embeddings_retrieval_query_omits_title` to ensure query
requests omit `title`.

> **Release Note / Migration Note:** Document vectors generated with
`gemini-text` (`source_task_type="retrieval_document"`) since `0.31.0`
included the literal `"Embedding of a document"` part in their content
payload; existing tables using `gemini-text` should re-embed documents
for consistent similarity scores.

### Verification
- `pytest -v python/python/tests/test_gemini.py` (`7 passed`)
- Verified wire payload via `google-genai` `httpx` request capture
(`content.parts` contains only document text; `title` is serialized as
top-level request field on `RETRIEVAL_DOCUMENT` and omitted on
`RETRIEVAL_QUERY`)
- `ruff check --config python/pyproject.toml` & `ruff format --check`
(`0 issues`)
2026-11-30 20:41:06 +08:00
lipeh1andlipeih 058ed93618 feat(python): support table checkout by timestamp (#5221)
Python callers can pass a `datetime` to `Table.checkout()` and
`AsyncTable.checkout()` to read several tables as of a single cutoff.
Each table is pinned to the highest retained version on its current
branch whose reported commit timestamp is at or before the cutoff. A
cutoff before all retained versions raises `ValueError`.

The Rust `Table::checkout_as_of` method scans the branch's retained
history and compares the commit timestamps at the precision supplied by
the backend. On Embedded it resolves and checks out the version on the
same dataset. If a concurrent tag checkout moves the handle to another
branch, it retries there before pinning the handle. On Enterprise it
follows all version-history pages on the same branch before checking out
the selected version. Servers that report only whole milliseconds can
group commits on opposite sides of a cutoff. For an exact reread, record
both the branch and version of each input after checkout, then reopen
the table with both values. Python interprets naive datetimes in the
system's local time zone and honors explicit UTC offsets.

The website guide includes a draft paragraph for the SDK release.

Closes #2293.

## Validation

- Built the Windows x64 native extension from this checkout with the
repository's `ci` profile and CPython 3.12.
- `test_table.py` passed 558 tests with 20 skips. `test_remote_db.py`
passed 759 tests with 2 skips using its HTTP test server.
- The new tests cover two tables at one cutoff, pinning after later
writes, recovery with `checkout_latest()`, a cutoff before the first
version, non-UTC input, tied commits, and a commit one nanosecond past
the cutoff. All three also passed with `TZ=EST5EDT`.
- A real Embedded handle switching branches during timestamp lookup
selected the wrong branch version in 40/40 attempts before the
concurrency fix and the expected version in 40/40 attempts afterward.
The Rust regression test forces that interleaving with a
filesystem-backed table.
- A two-page Enterprise HTTP fixture reproduced checkout at v1 with the
previous SDK and confirmed checkout at v2 after the fix. The Rust
regression asserts the branch and continuation token on page two and
reads back the pinned version. A separate test covers empty intermediate
pages and repeated tokens.
- Both Rust branch checkout tests and the `Table::checkout_as_of`
doctest passed with the `remote` feature enabled.
- Python SDK Ruff checks and formatting, Pyright, Rust formatting, and
Vale passed. Repository-wide Ruff reports 59 existing diagnostics in the
unchanged `docs/web-tests` files.

---------

Co-authored-by: lipeih <lipeihan@eazytec.com>
2026-11-30 20:40:10 +08:00