Commit Graph
3727 Commits
Author SHA1 Message Date
Xuanwo 4cab7d0b6f docs: show how to read and copy filtered blob rows (#5086)
The table guide starts with two tasks using the same `photos` table:
read the bytes of filtered images with the LanceDB Python SDK and copy
those images into another Enterprise table with `INSERT INTO … SELECT`.

The examples distinguish SDK descriptors, independent row-ID fetches,
Function readers and Enterprise 1.12.0 SQL results. The Enterprise
support page covers SDK, server and proxy compatibility when query-bound
reads fail.
2026-11-18 16:14:01 +08:00
Brendan Clement 13453ae5f8 docs: serve Attach Database at ingestion/attach-database (#5078)
The Attach Database page was renamed in the docs rework but kept its old
URL, `ingestion/migrate-from-embedded`. That reads like the wrong page
when we share the link.

This renames the file to `ingestion/attach-database`, updates its nav
entry and the two pages that link to it, and adds a redirect from the
old URL so existing links keep working.
2026-11-17 19:17:37 -08:00
Brendan Clement ee671533f9 docs: say the Tables page covers schema changes and field metadata (#5080)
The docs index lists each page by its title and description. The Tables
page holds the guide to field metadata, but its description only
mentioned creating, renaming and dropping tables.

In local runs of the agent evals, two of three docs-only agents searched
the index for "metadata", landed on the REST reference, and never found
the convention. This adds schema changes and field metadata to the
description and keywords, so that search finds the guide.
2026-11-17 19:06:45 -08:00
Brendan Clement e29ec0e084 docs: publish the CLI page (#5079)
The compaction guide links to `/tools/cli#install`, but `tools/cli.mdx`
was listed in `docs/web/.mintignore`, so the link had no target and
failed the broken-links check in the docs site build.

This removes the page from `.mintignore` and restores its nav entry and
the link from `basics/sql.mdx`, both dropped when the page was hidden in
#4859.
2026-11-17 13:58:48 -08:00
Bruno Ramirez 16af729792 feat(sdk)!: add typed SQL job handles for compaction and data prewarm (#5056)
Remote data prewarm used REST even though SQL supported filters and
concurrency, and both maintenance APIs returned after acceptance without
exposing a consistent typed completion handle. Compaction's legacy
statistics therefore could not describe the work committed by its
durable job. This PR adds job-returning compaction and data-prewarm
methods across Rust, Python sync/async and TypeScript, and moves
data-prewarm submission to SQL. Legacy methods retain
return-after-acceptance behavior; data prewarm now requires a compatible
SQL PREWARM server and Flight SQL connectivity. This consolidates #5037,
#5055 and #4906.

This was accomplished with the following changes:

- Added `compact_async()` / `compactAsync()` and `prewarm_data_async()`
/ `prewarmDataAsync()`, retaining the command receipt's durable job ID.
- Added `PrewarmDataOptions` for columns, a metadata-pruning filter and
concurrency; both operations inherit database, namespace and branch from
the table handle.
- Added filter/concurrency arguments to legacy Python `prewarm_data()`
and a TypeScript `prewarmData(options)` overload, preserving the
columns-array form and discarding the handle after acceptance.
- Added typed `CompactionResult` and `PrewarmDataResult` decoding,
including reopened jobs; missing result payloads fail explicitly and
omitted measurements remain unknown.
- Reused the shared Job lifecycle for status, refresh, progress
callbacks, cancellation and events; Python maintenance progress bars
display rewritten rows or completed executors.
- Added TypeScript `wait({ timeoutMs, onProgress })` and Rust
`wait_with_options(JobWaitOptions)`, complementing Python's existing
timeout argument without cancelling the durable job.
- Validated single unambiguous receipts, preserved compaction option
presence/default inheritance, and returned actionable unsupported-server
errors without dropping options or falling back to REST.
- Updated native bindings, API references and maintenance documentation
with job methods, result semantics, tuning and compatibility
requirements.

### Usage and behaviour

**New** = added here; **Enhanced** = existing support extended;
**Existing** = already on main. This table describes remote SDK
behavior; server-side SQL/CLI capabilities are prerequisites, not
additions made by this SDK PR.

| Surface | Capability | Compact | Data prewarm | Assessment |
| --- | --- | --- | --- | --- |
| Rust / Python sync+async / TypeScript | Submission transport |
Existing SQL OPTIMIZE | **New:** REST → SQL PREWARM | Both now submit
through SQL |
| All SDKs | Durable job-returning API | **New:** `compact_async` /
`compactAsync` | **New:** `prewarm_data_async` / `prewarmDataAsync` |
Same lifecycle model |
| All SDKs | Options and target scope | **New handle:** four existing
compaction overrides, with omitted fields inherited | **New options:**
columns/filter/concurrency | Namespace and branch preserved for both |
| Python / TypeScript | Legacy convenience calls | Existing optimize
acceptance behavior preserved | **Enhanced:** legacy methods accept
filter/concurrency and use SQL | Return after acceptance; no completion
wait |
| All SDKs | Typed successful result | **New:** committed rows,
file/fragment changes, partial commit and `more_work` | **New:** pinned
version, fragments and executor outcomes | Different measurements are
intentional |
| All SDKs | Status / refresh / progress | Existing Job APIs reused by
**new** maintenance handle | Existing Job APIs reused by **new**
maintenance handle | HTTP monitoring remains |
| Python / TypeScript | Progress presentation | **Enhanced:** rewrite
rows/groups | **Enhanced:** executor progress | Shared callbacks; Python
bars use operation counters |
| All SDKs | Bounded wait | Python existing; **new** TS/Rust timeout
controls | Same shared timeout support | Timeout stops this wait; job
continues |
| All SDKs | Reopen and await typed outcome | **New:** compaction result
decoding on reopened handle | **New:** prewarm result decoding on
reopened handle | Rust selects the typed result explicitly |
| All SDKs | Cancel / events | Existing shared APIs available on **new**
handle | Same | HTTP underneath; permissions unchanged |
| All SDKs | Typed preview helper | Unavailable | Unavailable | General
SQL where exposed; no helper added |
| Authorization | Submission | Existing table Ownership plus parent
Usage | SQL path uses Select plus parent Usage | Intentional difference
|
| All SDKs | Local / historical handles | New durable API rejects them |
New durable API rejects them | Remote current-branch jobs only |

```python
from datetime import timedelta

# Legacy convenience call: returns None after acceptance.
table.prewarm_data(["payload"], filter="id >= 1000", concurrency=4)

warm = table.prewarm_data_async(["payload"], filter="id >= 1000", concurrency=4)
warmed = warm.wait(timeout=timedelta(minutes=10), progress=print)
print(warmed.table_version, warmed.executors_completed)

compact = table.compact_async(compaction_options={"max_source_rows": 1000000})
committed = compact.wait(timeout=timedelta(minutes=10), progress=print)
print(committed.rows_succeeded, committed.fragments_removed, committed.more_work)

reopened_result = db.open_job(compact.id).wait()
```

```typescript
await table.prewarmData({ columns: ["payload"], filter: "id >= 1000", concurrency: 4 });
const job = await table.prewarmDataAsync({
  columns: ["payload"], filter: "id >= 1000", concurrency: 4,
});
const result = await job.wait({ timeoutMs: 600_000, onProgress: console.log });
```

```rust
use std::time::Duration;
use lancedb::job::JobWaitOptions;

let job = table.compact_async(Default::default()).await?;
let result = job.wait_with_options(
    JobWaitOptions::new().timeout(Duration::from_secs(600)),
).await?;
```

Python async tables await both submission and Job methods. Rust's legacy
`prewarm_data(columns)` keeps its columns-only signature; use
`PrewarmDataOptions` on the new job-returning method for
filtering/concurrency.

Wait deadlines cover pending status requests and polling delays.
Existing `wait()`, TypeScript `wait(callback)` and Rust
`wait_with_progress(callback)` remain supported.
Status/progress/refresh/cancel/events still use generic HTTP job APIs;
those endpoints and their read/event/cancel permissions must remain
available. Cancelling or timing out does not roll back committed work.

Compaction results describe committed rewrites and include deletion
files in file counts. Prewarm results describe work against a pinned
snapshot, with partial executors included in completed executors;
nonempty byte/range measurements remain unknown. Missing results require
compatible server/worker support rather than placeholder zero
statistics. Filtering uses conservative metadata pruning, not an exact
row-filter scan.

### Testing

Six checked-in live Python sync/async cases pass against matching
server/worker builds for compaction, job-returning prewarm and legacy
filtered submission. Ten additional live Node scenarios pass for
legacy/default/options forms, filters/concurrency, empty plans,
validation, persisted specifications and readback.

Targeted regressions pass: Python remote maintenance (80), shared jobs
(82), local prewarm rejection (4); Node remote (107) and prewarm API
cases (28), plus the previously exercised Rust remote regressions. Tests
cover receipt parsing, typed results, reopening, unknown measurements,
timeouts, and legacy calls returning None/undefined without polling.

Dependency pins are unchanged. Azure account-hint acknowledgment was
verified locally with filesystem storage; real Azure-backed storage
still needs deployment-specific validation.
2026-11-17 10:57:56 -08:00
Lance Release e3a0a29bdb Bump version: 0.42.0-beta.18 → 0.42.0-beta.19 v0.42.0-beta.19 2026-11-17 14:52:01 +00:00
Xuanwo 961a4518fd fix(remote): forward job statistics through refresh handles (#5071)
A Function refresh submitted through the LanceDB SDK returns a handle
wrapped for read-freshness tracking. lancedb/lancedb#5016 added
canonical `Job::stats()` on the server-job handle, but the refresh
wrapper did not forward `stats`. The returned handle therefore reported
`job statistics is only available for server-side jobs`, while
`db.open_job(<same id>).stats()` returned the server report.

Forward `stats` through the refresh wrapper and cover it at the public
refresh entry point. The regression submits with `refresh_column_async`,
then reads `stats` from that returned handle without reopening the job.
With the forwarding removed, the test fails with the same `NotSupported`
error; with the change, it passes.

Validation on `57b20fb11`: the targeted Rust test passed, `cargo fmt
--check` passed, and `cargo clippy -p lancedb --features remote --lib
--tests -- -D warnings` passed.

Part of ENT-3974.
2026-11-17 22:49:40 +08:00
Xuanwo 1670859327 fix(deps): ignore unmaintained chrono family advisories (#5073)
`cargo deny` fails on main because RUSTSEC-2026-0543 (`chrono`),
RUSTSEC-2026-0555 (`chrono-tz`) and RUSTSEC-2026-0542 (`humantime`) mark
the chrono family unmaintained. Add exceptions reviewed on 2026-11-17,
with the advisory links and the upstream migration constraint; none of
the three is a vulnerability and RustSec lists no patched version for
any of them (chrono recommends jiff/time).

Dependency paths (from `cargo tree -i` at version fb34b1c7 of main):

- `chrono` 0.4.45: arrow 59 / datafusion 55 and the lance stack, across
the workspace.
- `chrono-tz` 0.10.4: arrow-array → arrow → datafusion/lance.
- `humantime` 2.3.0: lance, object_store (through datafusion), and
xet-runtime.

Clearing the advisories requires the arrow/datafusion/lance ecosystem to
migrate off chrono; no upstream fix exists to consume. Also remove the
RUSTSEC-2026-0441 `pin-utils` ignore, which the current lockfile no
longer needs.

Validation on commit 04259a04 (cargo-deny 0.21.0, the version the CI
action installs):

- Before: `cargo deny check advisories` failed on the three
chrono-family advisories, and warned that the pin-utils ignore was not
encountered.
- After: `cargo deny check advisories bans licenses sources` passes all
four checks, matching the Rust CI deny job.
- `git diff --check` passes.
2026-11-17 20:58:43 +08:00
Jack Ye fb34b1c783 feat(functions): add row failure recovery APIs (#5048)
Function failures currently require callers to assemble row predicates
and manage retry/version/quarantine state themselves. Add exact
failed-row retry and Function upgrades through the Rust and Python
refresh APIs, plus Python helpers for grouped causes, failing input
rows, quarantine, and per-row producing-version metadata.

```python
errors = table.function_errors(column="sharpness")
errors.summary()
errors.rows(columns=["frame_index", "frame"])

table.retry_failed("sharpness", function_version="2").wait()
table.quarantine_failed("sharpness", after_attempts=3)
table.retry_failed("sharpness", include_quarantined=True).wait()
table.function_provenance("sharpness")
```

`upgrade_column(..., recompute="failed" | "all" | "none")` keeps the
column available while selecting the intended work. `history=True` reads
retained past errors. Capability checks reject these operations on
servers that cannot honor the workflow, before any refresh is submitted.

Includes synchronous/asynchronous API and older-server compatibility
coverage. Formatting applied; local builds and tests were not run.
2026-11-17 03:26:45 -08:00
Jack Ye ba4e3ef3f9 feat: expose Function worker stack inspection (#5043)
Adds `Job::stack(worker_id)` in Rust and `Job.stack(worker_id)` /
`AsyncJob.stack(worker_id)` in Python for server-side Function jobs. The
response preserves capture availability, timestamps, truncation, and
session details; unsupported local or query handles retain their
existing unsupported-operation behavior. Refresh wrappers forward the
request to their tracked server job.

```python
evidence = job.stack("worker-id")
for session in evidence["stacks"]:
    print(session["status"], session["stack"])
```

Requires a server implementing `/v1/jobs/stack` and system operate
privilege. The API propagates authorization and transport errors without
waiting for job completion. Existing progress snapshots already preserve
server warning fields.

Includes mocked request/response and synchronous/asynchronous Python
coverage. Local builds and tests were intentionally skipped as
requested.
2026-11-17 02:54:18 -08:00
Gatefixer fdd869a0f1 Merge main and align cosine fix with Lance beta.25 2026-11-17 09:31:14 +00:00
Lance Release 57b20fb11d Bump version: 0.42.0-beta.17 → 0.42.0-beta.18 v0.42.0-beta.18 2026-11-17 08:56:56 +00:00
Xuanwo 1a21698906 chore: update lance dependency to v15.0.0-beta.25 (#5069)
Update the Rust workspace, Java core dependency and Python test
dependency to [Lance
v15.0.0-beta.25](https://github.com/lance-format/lance/releases/tag/v15.0.0-beta.25).
Mark computed-column refresh replacements as data changes using Lance's
new explicit flag so refreshed values retain the existing index
invalidation and row-update behavior.

Rust API compatibility: the re-exported `CompactionOptions` adds
`max_data_files_per_fragment` and `scope`. Callers using exhaustive
struct literals must include the new fields or use
`..Default::default()`.

Configure macOS Rust tests with an explicit Python 3.13 interpreter and
runner/Python-specific caches so doctests do not link against an absent
Python framework.
2026-11-17 16:55:26 +08:00
Jack Ye e61252f4dc feat(python): capture Arrow and structured Function globals (#5044)
Function source packaging inlined only scalar literals and tuples of
them. A module-level PyArrow type shared by `output_schema=` and the
Function body, a label map, or a small NumPy weight vector failed at
decoration with an "unsupported global value" error and had to be
redefined inside the body. These globals are now captured:

```python
import numpy as np
import pyarrow as pa
from lancedb import function

OUT_TYPE = pa.struct([pa.field("label", pa.string()), pa.field("score", pa.int32())])
LABELS = {"pick": 0, "place": 1}
WEIGHTS = np.array([0.25, 0.75])


@function(
    input_schema=pa.schema([pa.field("x", pa.int64(), nullable=False)]),
    output_schema=pa.field("out", OUT_TYPE, nullable=False),
    pip=["numpy"],
)
def judge(x: pa.Array) -> pa.Array:
    score = int(WEIGHTS.sum() * 10)
    rows = [{"label": "pick", "score": LABELS["pick"] + score}] * len(x)
    return pa.array(rows, type=OUT_TYPE)
```

| Captured global | Rebuilt in the artifact as |
| --- | --- |
| `None`, `bool`, `int`, `str`, `bytes`, finite `float` | a literal
(unchanged) |
| tuple, list, dict, set, frozenset of supported values | a literal;
dicts keep insertion order, set elements are sorted by their source |
| PyArrow `DataType`, `Field`, `Schema` | `pa.ipc.read_schema` over the
value's IPC schema bytes, which keeps nullability, metadata, and nested
fields |
| NumPy array or scalar of a bool, integer, float16, float32, or float64
dtype | `np.array(<elements>, dtype=<dtype.str>)` or
`np.dtype(<dtype.str>).type(<item>)` |

- Each value is a copy taken when the decorator runs and rebuilt per
worker process, so values that share an object become separate copies.
Packaging does not depend on hash randomization.
- Each value is limited to 1 MiB of source and 32 levels of nesting.
Cycles and Python-defined Arrow extension types are rejected. The size
limit also applies to the existing literal captures.
- Unsupported values keep the error that names the global, its type, the
supported captures, and the remedy.
- `pyarrow` and `numpy` are imported under private aliases ahead of the
captured globals. The builtins used for empty sets and frozensets are
claimed, so a module that rebinds them fails packaging instead of
silently shadowing them.


Empty NumPy arrays are encoded directly from dtype and shape, so even
`(500_000, 0)` stays compact without expanding nested Python lists.
2026-11-17 00:10:59 -08:00
Xuanwo ff9dc7a2be feat(function): expose descriptor refresh plan in terminal result (#5064)
## Summary

Add the terminal plan shape for Function-backed refresh results:

- `FunctionRefreshPlan` describes the descriptor-derived size tiers,
selected worker classes, batch bytes, row counts, and batch counts.
- `FunctionRefreshTier` describes one byte-bounded tier.
- `RefreshColumnResult.plan` carries the plan in the public terminal
result, optional and omitted when absent.

This is the SDK prerequisite for descriptor-first Function refresh
planning. It only exposes the shared result shape; it does not compute
the plan or change refresh execution.

## Compatibility

Existing terminal payloads and callers are unchanged: the new field is
`#[serde(default, skip_serializing_if = "Option::is_none")]`, so absent
plans stay absent and old payloads decode to `None`.

## Validation

- `git diff --check`
- Unit tests cover absent-plan serialization and plan round-trip.
- Repository CI on this PR.
2026-11-17 13:48:13 +08:00
Xuanwo c278f90cc1 feat: expose shared Arrow type golden behind test-fixtures (#5065)
Downstream compatibility tests currently load the Function Arrow type
golden from a LanceDB source checkout. Add a default-off `test-fixtures`
feature that exposes
`lancedb::test_fixtures::FUNCTION_ARROW_TYPES_JSON`, so consumers can
enable it on their existing LanceDB dev-dependency and use the golden
from the same revision.

The golden stays in its existing location with unchanged bytes.
LanceDB's Rust test reads the exported constant; Python tests and
release/versioning workflows remain unchanged.
2026-11-17 13:31:32 +08:00
Gatefixer 89f6f3ab82 Merge main and align cosine fix with Lance beta.23 2026-11-16 20:23:43 +00:00
Lance Release bf4d6c8083 Bump version: 0.42.0-beta.16 → 0.42.0-beta.17 v0.42.0-beta.17 2026-11-16 19:56:16 +00:00
LanceDB Robot 161318466a chore: update lance dependency to v15.0.0-beta.23 (#5063)
Updates the Rust workspace and Java Lance dependencies to
[v15.0.0-beta.23](https://github.com/lance-format/lance/releases/tag/v15.0.0-beta.23),
with the matching Python `pylance==15.0.0b23` test pin and refreshed
Cargo and uv lockfiles. No source compatibility fixes were needed.

Validation: workspace Clippy with all features and warnings denied, Rust
formatting, all 35 CI-script tests, Python dependency guards, Python
formatting/lint, and uv lock consistency checks passed; the root-wide
Ruff check has 59 pre-existing diagnostics, confirmed unchanged from
HEAD.
2026-11-17 03:50:28 +08:00
Xuanwo 3b7c4dcf66 fix: allow matched merge updates to Function inputs (#5062)
Matched merge-insert updates rejected every non-key source column that a
Function binding reads, while update already accepts input changes and
the merge freshness path records their changed signatures. Use the same
`ensure_not_written` guard for the matched source columns: inputs pass,
computed outputs and assignment columns stay rejected before any write,
and insert-only or unrelated-column merges keep their behavior.

Regressions confirm a matched input update retains prior outputs,
dirties only the affected rows, keeps an independent binding fresh, and
rejects mixed input/output sources without committing.

Tested on `2ab103d7` + this change: `cargo test -p lancedb --lib` 1083
passed, 82 ignored.

Refs ENT-3515
2026-11-16 20:23:25 +08:00
Lance Release d475005592 Bump version: 0.42.0-beta.15 → 0.42.0-beta.16 v0.42.0-beta.16 2026-11-16 11:40:59 +00:00
Xuanwo c7d972fe48 fix(python): explain blob descriptor copy guidance (#5060)
The descriptor-copy error only named the missing `data`/`uri` child. It
now says that this shape is an SDK blob descriptor rather than payload
bytes, and points to `blob_mode="bytes"` for supported materialization,
`blob_mode="descriptions"` for inspection, and the row-id plus
`fetch_blobs`/`fetch_blob_files` copy path while the source stays
unchanged.

This reuses the merged guidance from #4940 and the
direct-materialization contract from #4973. Ray integration remains out
of scope for ENT-3556.

Refs ENT-3556

Test: `python/tests/test_blob.py` (210 passed, 39 skipped), including a
regression that writes default lazy descriptor rows into a blob-schema
table, checks the guidance, and confirms no target is created.
`python/tests/test_util.py -k blob` (12 passed, 2 skipped).
2026-11-16 18:56:39 +08:00
Gatefixer 790f34501c Merge main updates into gatekeeper/fix-4911-1 2026-11-15 14:57:14 +00:00
Lance Release 2ab103d775 Bump version: 0.42.0-beta.14 → 0.42.0-beta.15 v0.42.0-beta.15 2026-11-15 14:06:09 +00:00
LanceDB RobotandJack Ye 613653a7db chore: update lance dependency to v15.0.0-beta.22 (#5057)
Update Rust and Java Lance dependencies to
[v15.0.0-beta.22](https://github.com/lance-format/lance/releases/tag/v15.0.0-beta.22),
synchronize the Python test pin to `pylance==15.0.0b22`, and refresh the
lockfiles with all published platform wheels.

Preserve Function freshness only when an UPDATE changes rows, so
beta.22's no-match updates cannot mark previously invalidated outputs as
fresh. Extend the existing regression cases to cover no-match updates
after input and output changes, including unchanged table versions.

Rust formatting passed. CI validates the compatibility fix; no local
builds or tests were run.

---------

Co-authored-by: Jack Ye <yezhaoqin@gmail.com>
2026-11-15 06:04:30 -08:00
Jack Ye 3aed07c396 fix(python): show Function registration progress and image details (#5040)
Report registration lifecycle and client elapsed time through existing job handles, and provide concise image inspection. Preserve quiet wait behavior, environment-lock forwarding, failure diagnostics and timeout recovery.
2026-11-15 02:05:06 -08:00
Jack Ye 1feec84d2b feat(python): expose FTS operators and match counts (#5042)
String full-text searches now accept `operator="AND"` or
`operator="OR"`, preserving the existing OR default. Sync and async FTS
builders expose `count_rows()` to count every match satisfying the
filter, independently of pagination, projection, ordering, and
reranking. Counting streams matching scores without reading document
columns; it can scan all matches.

```python
query = table.search("gripper closed", query_type="fts", operator="AND")
query = query.where("active = true")
matching_rows = query.count_rows()
page = query.limit(20).to_list()

query = await async_table.search("gripper closed", query_type="fts", operator="AND")
matching_rows = await query.where("active = true").count_rows()
```

Phrase searches keep the existing index default and now explain how to
rebuild an index with `FTS(with_position=True)`. AND requests retain
their operator through namespace pushdown and fail explicitly on older
remote servers that cannot represent it. Regression coverage includes
indexed and unindexed queries, filtered counts above the default limit,
pagination preservation, remote serialization, and phrase indexes with
and without positions.
2026-11-15 01:21:28 -08:00
Jack Ye f17a07a2cd feat: expose server-side job listing filters (#5041)
Expose server-side job filters and lazy Listing indexing, slicing, and length helpers. Document cache, cursor, and SDK/server compatibility behavior.
2026-11-15 00:50:58 -08:00
Lance Release 530d379fc4 Bump version: 0.42.0-beta.13 → 0.42.0-beta.14 v0.42.0-beta.14 2026-11-15 02:09:01 +00:00
Jack Ye e8a8dd1b2a feat(sql): use server-issued catalog listing tokens (#5026)
Migrates SQL-backed catalog listing APIs to `LIMIT ... FROM
'<page-token>'` and server-issued Arrow continuation metadata.
Namespace-specific APIs send an explicit `IN` schema clause, including
`IN "public"` for root, so raw SQL can default to all namespaces.

```sql
SHOW VIEWS LIMIT 100;
SHOW VIEWS IN team$ml LIMIT 100;
SHOW VIEWS IN team$ml LIMIT 100 FROM '<page-token>';
SHOW VIEWS IN other_db.team$ml LIMIT 100;
```

SDK clients forward opaque tokens unchanged, preserve empty
continuations, and decode identifier columns by name. Removes legacy
cursor reconstruction and updates the SQL reference and Python Flight
fixture. Public docs cover optional direct schema paths, all-namespace
defaults, and the shared pagination syntax across every catalog listing.
2026-11-15 08:55:42 +08:00
Xuanwo e2f836da99 feat: expose per-call merge retry controls in Python and Node (#5015)
Python and Node callers could not disable precommit retries for one
merge without changing the connection. Add `execute(..., retries=0)` for
Python sync/async and `execute(data, { retries: 0 })` for TypeScript,
forwarding into the existing Rust control without persisting the
override. Ambiguous 5xx outcomes remain non-replayable; permitted merge
retries now log status and attempt at WARN, and the API docs explain
retry budgets and timeout boundaries.

Validation at `6001300` passed 70 Python HTTP cases, 36 Node HTTP cases,
14 local merge regressions per binding, and 34 scoped Rust tests, with
rebuilt native extensions, TypeScript compilation, Clippy, scoped
formatting/lint, and generated API docs. The public API and feature diff
are unchanged after integrating main and the reviewed ingestion guide;
that binding evidence is retained. Focused merged-tree validation
additionally passed 267 Rust merge/retry/provenance cases and the CI
fixtures. Existing root Ruff issues in docs/web-tests remain; local
fixtures do not establish live proxy/server cancellation behavior.

Refs #4256 and OSS-2370.
2026-11-14 22:43:56 +08:00
Xuanwo dc9eb269b1 feat(python): support map and decimal Function signatures (#5031)
Python Function declarations reject Arrow map and decimal types before
registration. Accept `dict[str, T]`, nullable map values, explicit Arrow
maps, and `Annotated[Decimal, pa.decimal128/256(...)]` using the
existing canonical JSON representation. Preserve map key/value
nullability and decimal precision/scale; reject unsupported map keys,
sorted maps, nested Blob values, and a bare Decimal without
precision/scale.

This is the SDK map/decimal portion of ENT-3414. Server validation and
SQL support are separate changes; older servers can still reject these
signatures. Nullable scalar output support remains separate in #5030.

Validation: 129 Function signature tests passed; 30 documentation tests
passed with one existing skip. Ruff format/lint and diff checks passed.
Python tests used the existing Python 3.13 environment and prebuilt
native extension with this Python source overlaid; no Rust build or
remote-server execution was performed.
2026-11-14 22:30:47 +08:00
Xuanwo 2499342fa1 feat(function): expose resolved environments and fresh lock requests (#5034)
Function registration clients cannot request fresh dependency resolution
or inspect the measured environment returned by the server. Add
`refresh_lock=True` to Python registration and preserve the requested
runtime and measured environments in Rust/Python Function version
readback. Registration forwards both `exist_ok` and `refresh_lock`;
defaults remain unchanged.

Single-platform versions retain `resolved_environment`.
Multiarchitecture versions expose `resolved_environments`, keyed by OCI
`os/architecture`, and the Python `environment_report` alias. Platforms
are never flattened: absent entries mean unknown measurements, while
measured empty package lists remain present. Registration waits emit
scalar and per-platform server warnings once per Job; catalog reads do
not repeat them.

Requires matching server support, including Sophon #10344 for
per-platform publication. Nine focused Python source-overlay tests and
29 documentation tests passed for the additive map change; one
documentation test requiring a newer native `exist_ok` binding was
excluded. These checks reuse a prebuilt extension and do not establish
current native integration. PR CI exercises the Rust transport/readback
and Python bindings. Live multiarchitecture registration and GPU
acceptance remain separate.
2026-11-14 22:30:28 +08:00
Xuanwo ea59f8acb6 feat(python): preserve Function timestamp and duration types (#5032)
Function declarations currently reject exact timestamp and duration
types. Preserve their Arrow units and timezones in canonical signature
JSON, including fixed-offset timezones and nested fields. Bare
`datetime` and microsecond/no-timezone declarations keep their existing
representation; `timedelta` requires an explicit unit.

Compound temporal signatures require the Lance Namespace decoder in
https://github.com/lance-format/lance/pull/11059 and corresponding
server validation support. Older readers reject these signatures; this
change does not upgrade server support or dependency pins.

Validation: 128 Python signature tests and 30 documentation tests passed
(one skipped), using the changed Python source with an existing native
extension. No Rust rebuild or end-to-end Function registration/refresh
was performed.
2026-11-14 21:49:45 +08:00
Gatefixer a3f579399f Merge main updates into gatekeeper/fix-4911-1 2026-11-14 13:32:49 +00:00
Gatefixer 06a1934a28 Merge main into gatekeeper/fix-4911-1 2026-11-14 13:05:36 +00:00
Xuanwo 12b95b59ab feat(function): support literal inputs in column declarations (#5021)
Function-column declarations now preserve constants such as
`fn(video=col("mp4"), num_frames=lit(16))` without changing its Function
version. Constants travel in the application inputs; column bindings,
request input schemas, and dependency tracking contain only columns.
Changing a constant uses a new column binding rather than rebaking the
Function.

Persisted bindings with literals use metadata version 2, which older
readers reject. Column-only bindings retain version 1. Python preserves
scalar literal identity, including null and unsigned integers, and
rejects composed expressions or values outside the canonical literal
domain.

This SDK change requires matching server declaration and execution
support, after a dedicated SDK dependency update. Native validation
passed 48 Rust metadata tests, four request-transport cases and 57
rebuilt Python tests on `a42d680`; 32 pre-existing experimental tests
remained ignored. The test-assertion correction passed its exact
regression and strict Clippy on `53ff80a2`. On `993fae7d`, the three
remote metadata compatibility regressions, native Python public-export
test and strict Clippy passed. These review corrections use v3 for
unknown-version rejection, cover existing v2 literal bindings through
remote mutation guards, and export `LiteralInputBinding`. The unchanged
native implementation and verified extension are reused. Matching server
execution and original-workload acceptance are not established by this
PR.

Refs ENT-3667.
2026-11-14 20:59:52 +08:00
Xuanwo f6f8119ba4 feat: expose structured Function refresh options in SDKs (#5047)
## Problem

ENT-3267 still lacks typed refresh controls for `supervisor_resources`
and `planning_workers` in Python, Rust, and Node, and Node has no
`retry_policy` refresh option. Callers must drop to SQL for those
controls.

## Change

- Add canonical Rust `FunctionRefreshPodResources` and
`FunctionRefreshPlanningConfig`, and serialize them through
`RefreshColumnOptions`.
- Expose both options in the Python sync/async wrappers and PyO3
binding.
- Expose both options in the Node NAPI object and add a Node
`retryPolicy` object backed by the existing Rust `FunctionRetryPolicy`.
- Omitted options stay omitted; branch targeting continues through the
table handle. No server, dependency, or pin changes are included.

Client-side checks only reject non-positive structural values.
Deployment resource limits and column-kind validation remain
server-side.

## Validation

`cargo fmt --all -- --check`, `python3 -m py_compile`, and `git diff
--check` pass. No native build was run locally; CI compiles and tests
the change. Generated JS API pages are unchanged.
2026-11-14 20:59:44 +08:00
Xuanwo 4843ac4c7e fix(remote): observe new publications while waiting for Function freshness (#5033)
Remote `wait_fresh()` could keep observing a cached table version after
automatic refresh published new outputs. Each poll on a latest handle
now requests a current snapshot, so the wait can finish without an
external `checkout_latest()` call. Explicit version, tag, and
query-snapshot selections remain pinned.

The wait preserves existing finalization-pending and error handling and
continues to perform read-only status requests.
2026-11-14 20:59:41 +08:00
Xuanwo e5a5b67212 feat: support nullable scalar Function declarations (#5030)
Function declarations currently reject nullable scalar returns. Accept
`Optional[T]`, `T | None`, and explicit nullable Arrow fields,
preserving `nullable: true` in registration signatures, JSON round
trips, and remote `add_columns` requests.

The Rust planner accepts nullable scalar outputs, and binding readback
recognizes the server-owned assignment marker for a single nullable
scalar result. Clients do not allocate that marker. Non-nullable whole
results, whole structs, and Blob v2 retain their existing assignment
restrictions.

Validated with 127 Python tests, 30 documentation tests (1 skipped), and
seven focused Rust tests covering planning, binding readback, rejection
boundaries, and the remote request body. The final condition-collapse
change addresses strict Clippy; its delta check and CI are pending.
Python tests use a source overlay on a retained native extension, and
Rust remote coverage uses HTTP mocks.

Server support and end-to-end validation remain separate. This PR does
not claim that server publication distinguishes computed NULL values
from pending rows.
2026-11-14 20:59:20 +08:00
Xuanwo 005b33fa8b fix: preserve terminal server identity in failed job waits (#5024)
A failed remote Function job loses its persisted build identity when
converted into the exception from `job.wait()`. Append
`result.terminal_server` to that error using the existing server-build
format, preserving its message, row location, traceback and job ID. Do
not substitute the responding query node's version for the writer of the
saved terminal result; missing or malformed historical identity leaves
the error unchanged.

The reported failure was independently reproduced against a deployed
server with a real Function job. The new exact Rust regression
reproduces the missing terminal identity on the unpatched code. At
`59c1f3e`, all 10 remote Job Rust tests and five tests using the
matching native Python extension passed, including sync/async waits with
known or unknown terminal identity. These transport tests use mocked
HTTP responses; the original deployed Function job remains with
independent acceptance for recheck after delivery. This change does not
establish whole-ticket acceptance.
2026-11-14 20:59:10 +08:00
Xuanwo 0d55457d9e test(node): make blob read cancellation deterministic (#5029)
The Node blob cancellation test assumes a 32 MiB local read is still in
flight when JavaScript immediately aborts. The native future can finish
first, in which case returning its completed buffer is valid.

Replace that timing assumption with the existing HTTP fixture: send one
byte of a five-byte range response, hold back the remaining body, then
abort. Verify `AbortError`, response disconnection, listener cleanup,
and a subsequent read on the same handle with the single request permit.
Existing local pre-abort, successful-read, cursor, and close coverage
remains in place; production cancellation semantics are unchanged.

Validated the 97 scoped Blob tests on Linux x64 / Node 22.23.4 with both
a locally built beta18 binding and the [beta19 native binding built for
#4967](https://github.com/lancedb/lancedb/actions/runs/43381450237/job/131739908253).
The beta19 run used the published repair tests at `8096f848`, passed all
97 cases with exit 0, and verified the downloaded artifact digest,
loaded binding hash, and native build checkout against #4967's source
tree. The pre-existing `CustomGC` import diagnostic remains; the process
exited normally.

The [hosted macOS ARM64
job](https://github.com/lancedb/lancedb/actions/runs/43395339041/job/131784902005)
also passed the cancellation regression and the complete applicable Jest
suite: 1,695 tests passed and 22 were skipped on Node 24.22.2 / beta18.
Its actual merge checkout `e906a2da` has matching test, native Blob,
dependency, and workflow sources to PR head `8096f848`.

A separate [macOS ARM64 / Node 22.23.4 / beta19 composition
run](https://github.com/lancedb/lancedb/actions/runs/43559120836/job/132353156252)
now passed 1,694 tests (23 skipped), including both in-flight
cancellation and later-response-body cancellation/permit release. It
tested the normal merge of #4967 `6b175764` and this repair `8096f848`,
at validation head `144e5294` whose only subsequent change narrows the
workflow and disables publication. The loaded native binding hash and
downloaded artifact digest were captured. The original failed #4967 job
is preserved; this separate validation does not replace normal
prerequisite integration or current-branch CI on #4967.
2026-11-14 20:57:49 +08:00
Xuanwo 56c4b3a6f2 ci: stabilize macOS Node toolchain and build budget (#5017)
The macOS Node job installed floating stable before restoring the Rust
cache, although native builds use the repository-pinned compiler. Use
the existing file-aware Rust setup action with its implicit cache
disabled so setup, cache selection and compilation use the same pin and
one cache owner. Preserve the existing native build flags.

Allow 35 minutes for the complete macOS job. In the [pinned-toolchain
cold
run](https://github.com/lancedb/lancedb/actions/runs/43291714333/job/131439350321),
native compilation finished in 28m02s, but setup and packaging exhausted
the former 30-minute job limit before TypeScript checking and Jest.
Retained full Jest runs took 38–59 seconds; the new bound covers the
measured work with a small margin. The runner, build profile, features,
targets and complete test commands are preserved.

Hosted acceptance at `ff718c03`: the [complete macOS
job](https://github.com/lancedb/lancedb/actions/runs/43300424344/job/131469805138)
succeeded within the 35-minute limit (20:27:07–20:56:58 UTC). Native
compilation took 27m38s; the complete applicable Jest suite passed 1,695
tests, with 22 skipped, in 46.129s. This single successful run does not
guarantee every cold-build duration, validate the separate beta19
composition, or establish the cause of the DynamoDB timeout.
2026-11-14 20:55:23 +08:00
Xuanwo 193f203b72 ci: run remote Functions gate only in the full test suite (#5022)
The remote job runs the default local Functions gate twice: once before
building the remaining test targets, and again in the full remote suite.
Run it only through the existing full suite, removing the serial Cargo
invocation barrier while retaining the same features, authentication
wrapper, targets, and 30-minute deadline.

The [hosted remote
job](https://github.com/lancedb/lancedb/actions/runs/43302507952/job/131477104217)
at `7886d79e` completed successfully in 25m36s within the unchanged
30-minute limit. Its full suite passed 2,164 unit, 114 integration, and
120 doctests, including the three default gate tests. This single run
establishes completion for that workload, not a general timing
improvement or cold-build guarantee. The branch now includes main's
Cargo artifact fixture repair (#5010). The workflow, full-suite command,
authentication wrapper, three default Functions gate tests, and
30-minute deadline are unchanged from that hosted run. The 2,398-test
result remains evidence for `7886d79e`. On the updated head `810d6558`,
the [hosted remote
job](https://github.com/lancedb/lancedb/actions/runs/43382023177/job/131741745645)
completed in 17m58s with 2,171 unit tests, 119 integration tests, and
122 doctests passing (82 ignored), including all three default Functions
gate tests. This is current-head execution evidence, not a controlled
speedup comparison.
2026-11-14 20:54:19 +08:00
Xuanwo beda423318 fix(node): bind blob byte queries to their response snapshot (#5019)
TypeScript remote `toArrow` and `toArray` could combine scalar values
from query snapshot A with Blob payloads from a later snapshot B. Cached
table schemas and native descriptor layouts could also leave descriptors
in a `blobMode: "bytes"` result.

Discover Blob fields and snapshot provenance from the executed query
stream, recognizing canonical native v2 descriptors as well as
extension-marked fields. Fetch payloads through an independent Rust
snapshot handle bound to the query version and immutable dataset
identity, without changing the live table. Preserve aliases, nested
fields, NULL/empty values, explicit row IDs, and scalar-only results.
Hybrid byte queries require matching provenance from both actual
responses. Missing or mismatched server provenance fails explicitly;
logical-input validation and local materialization remain unchanged.

Manual integration validation at `4daf354df`: all five real SDK/NAPI →
Sophon REST scenarios passed. Both `toArrow` and `toArray` retain A
bytes across overwrite and reject same-name/same-URI recreation even
when version and row IDs are reused. A previously cached handle
discovers a subsequently added Blob field. Ten actual payload fetches
include the two expected identity rejections; later queries on the same
live handle read B. The canonical-descriptor and Blob regression suites
pass 119 tests, with independent source and wire-evidence review.
Earlier broader SDK and hybrid evidence is retained within its
unchanged-source scope.

This is local REST interoperability evidence, not deployed
Cloud/header-forwarding acceptance. Remote bytes require the
authoritative server version/identity and fetch-echo contract. CI and
formal review remain merge requirements; this follow-up does not close
ENT-3556 or Blob V2 GA.
2026-11-14 20:52:50 +08:00
Xuanwo 2f496322ef fix: report multipart rows only after part acknowledgement (#5020)
Remote multipart progress currently counts every scanned row before the
corresponding IPC part is acknowledged. A rejected first part can
therefore report uploaded rows, even though its acknowledged byte count
remains zero.

Count both rows and IPC bytes only after each part succeeds, including
parts assembled from multiple batches or split from one batch. Retried
parts count once. Native and single-request writes retain their existing
accounting; acknowledged multipart progress describes staged data, not a
successful commit.

Validation follows the actual TCP upload path: one scanned batch becomes
six decoded IPC parts, the sixth response is lost, and each
request/retry observes only previously acknowledged rows and bytes.
Rejection and complete-outcome cases preserve the same accounting
boundary. This validation covers local HTTP behavior; deployed service
throughput and the original disconnect investigation remain outside its
scope.


Frozen candidate validation: 839 remote tests and 7 progress tests
passed. Scoped Clippy (`lancedb`, remote feature, lib/tests/examples,
warnings denied) passed with unchanged source. Python/Node bindings were
unchanged and were not rebuilt for this patch.
2026-11-14 20:51:25 +08:00
Lance Release 5de76bd8ed Bump version: 0.42.0-beta.12 → 0.42.0-beta.13 v0.42.0-beta.13 2026-11-14 12:33:27 +00:00
Yang Cen e1a10eaa66 chore(deps): upgrade Lance to v15.0.0-beta.21 (#5046)
Upgrade the Rust Lance family from beta.18 to the published
v15.0.0-beta.21 tag, and align Python test wheels and Java artifacts.
This includes the explicit-empty-segment FTS fix in
lance-format/lance#11063 needed by lancedb/sophon#10314. Enable Windows
Git long paths so Cargo can check out Lance fixtures in the Rust, NPM
and Python wheel builds.

Beta.21 also contains lance-format/lance#9858: new NGram, RTree and
MinHash LSH indexes use row addresses. Legacy row-ID segments remain
readable, but index maintenance on stable-row-ID tables can require a
rebuild. The NGram documentation now explains the consolidation
requirement; NGram/RTree tables without stable row IDs retain their
earlier format. The Python lock revision and unrelated dependency
entries are unchanged.

Validation:
- The official Lance release and internal mirror match
80bc45a195279befdec42853dac8d15a37e0504d. The seven official Fury wheels
and Maven POM/JAR were verified.
- Exact executable/dependency state 7846a15e completed the full Rust,
Python, Node, Java and CLI CI, including platform builds and package
publication dry runs. Xuanwo approved that head; Gatekeeper recommended
approve with a non-blocking qualification risk.
- Follow-up a289cb2c only adds the requested seven-line NGram upgrade
note. Static whitespace checks passed; new-head CI is running. No local
correctness tests or test builds were run by this task owner.
- Broader IVF/encoding/Blob/cache workload performance and the beta.21
Sophon composition remain separately qualified. Earlier Blob
cancellation and DynamoDB failures on #4967 are retained in their
original evidence; this PR does not count those historical failures as
fixed.

Current-head CI, full feedback and required review still gate merge. SDK
publication is a separate action. Sophon adoption follows a published
SDK release and mirror through its own dependency PR; its distributed
performance acceptance remains in #10314.
2026-11-14 20:22:13 +08:00
Jack Ye dd449978d9 docs: clarify Function workflows and search contracts
Clarify Function signatures, refresh and recovery workflows, job snapshots, FTS operators, and IVF deduplication limits.
2026-11-14 01:09:40 -08:00
Xuanwo 97e62dc11b feat(remote): expose canonical job statistics reports (#5016)
Expose `Job::stats()` in Rust and synchronous/asynchronous Python jobs.
It reads `POST /v1/jobs/stats` and returns the canonical server-rendered
report verbatim, or `None` for a running job or one without a readable
durable profile. It does not wait for completion or recompute
measurements.

On `cc25005525671756b5cf5ebd96492b792e9aa1cb`, all three Rust transport
tests and six Python tests passed against the matching rebuilt native
extension; strict SDK Clippy also passed. These tests cover optional
reports, exact text preservation, fresh reads, errors, and the HTTP
boundary with a controlled server. Against the actual Phalanx HTTP route
from [Sophon #10247](https://github.com/lancedb/sophon/pull/10247)
(`5be3236`), the same native extension also completed two sync and two
async reads after durable registry archival, preserving the exact
canonical report. This is an HTTP/registry integration fixture, not a
Function workload or shared-cluster acceptance. The private runner's
JSON field-order collector failed after the successful probe; all raw
evidence was retained and hash-verified, and the original receipt was
recovered with the corrected parser without rerunning the probe.

The follow-up `ad36f66` only corrects the synchronous Python
API-reference link to the asynchronous method. Ruff checks and
formatting passed; runtime evidence above remains applicable. The actual
Phalanx/native-SDK probe covers archived reports; running-job null
availability is covered by separate backend and SDK transport tests, not
that end-to-end probe.

Part of ENT-3501.
2026-11-13 23:41:33 -08:00