An older Function catalog can reject the query generated by
`get_function` at `FORMAT`, or by `list_functions` at `LIMIT`. When the
operation receives its exact trailing-input diagnostic at submission,
append guidance on matching the Python SDK to the Enterprise build. Keep
the original SQL error, request ID, gRPC status and any build metadata
supplied by the server.
Compared 24 loopback Flight responses through the public synchronous and
asynchronous Python APIs against the published b38 wheel. Eight lookups
and listings gained the pairing guidance. The other 16 responses
preserved their error types and diagnostics, including authorization,
missing resources and unrelated parser failures. The candidate passed
122 Python tests and four Rust tests. Current catalog reads and opaque
continuation tokens also worked after build discovery returned 404.
`@function(gpu=True)` currently serializes `gpus_per_worker: 1` even
when the caller omits `gpu_count`. This prevents registration on servers
that support single-GPU Functions but reject an explicit GPU count
field.
Preserve omission through registration and runtime digest calculation.
The effective default is still one GPU per worker. With an explicit
`gpu_count=1` or `gpu_count=2`, the request and digest include the
declared count. As a result, the omitted and explicit-one forms now have
distinct runtime digests even though both request one GPU in practice.
The regression test captures the Flight SQL `CREATE FUNCTION` request
for CPU, omitted GPU count, and explicit counts of one and two. Only the
omitted-count case failed on the base revision. All 34 focused Python
tests and Ruff checks passed on the candidate Python source with a
compatible native extension. Local replay of the captured requests
against the registration admission code confirmed that the older
implementation accepts the omitted count and that the current
implementation resolves the four effective counts to 0, 1, 1 and 2.
Enterprise SDKs use an inclusive 32 MiB default for eligible Blob V2
direct reads. The paired field comparison with the 10 MiB SDK default
measured higher direct-read latency at 10 and 16 MiB. At 32 MiB, the
interval for the latency difference spanned zero. [SDK version used in
the field comparison](https://github.com/lancedb/lancedb/pull/5247)
The earlier mixed-load test measured lower Plan Executor cache pressure
with direct reads enabled at the 10 MiB cutoff. That result covers the
tested size mix. With the 32 MiB cutoff, reads from 10 MiB up to (but
excluding) 32 MiB go through the proxy, so the impact on executor
traffic and cache pressure depends on the workload's size distribution.
The existing internal override still takes precedence. Direct reads keep
the 16 MiB part size. The Node binding test verifies proxy routing one
byte below the default and two contiguous object-store ranges with a
matching SHA-256 at exactly 32 MiB.
## Behavior
Presigned Blob V2 reads retry an idempotent ranged GET once after a
recognized disconnect or timeout before the complete response headers
arrive. This includes an abrupt TLS EOF while receiving the headers. A
retry preserves the physical Range and the still-valid URL. Expiry
triggers resolution on the pinned snapshot. Once the complete headers
arrive, the existing status and body paths handle the response.
Enterprise connections default to a 300-second pool idle timeout and
presigned object-store connections default to 30 seconds. The existing
override applies to both pools.
Loopback TCP tests exercise FIN and RST on a reused connection, both
with zero response bytes and after a partial header. They verify the
send count with retries enabled and disabled, the exact replayed Range
and the payload digest. A truncated body after complete headers returns
an error after one send.
Direct reads over 16 MiB stream bounded physical ranges into their
corresponding slices of the final buffer. The per-read fan-out uses
Lance's `LANCE_IO_THREADS`, capped by the connection's existing
`LANCE_CLIENT_BLOB_REQUEST_CONCURRENCY` limit (8 by default). Each
request retains its permit through body consumption. The 10 MiB routing
threshold continues to apply to the full logical read.
The connection can reuse unexpired presigned locations for verified rows
under the same table, column, snapshot and request credentials. Range
offsets and sizes come from the resolver. The existing batch request
covers the requested rows of a shared Packed or Managed sidecar.
Reopening a verified row uses its prior resolution, and the first open
of each unseen SQL descriptor still authorizes just that row. The public
API and REST response format are unchanged.
Closes#3042.
Node `select()` now takes `Expr` values, the same expression builder
that `where()` already accepts. A `Map` or a plain object can mix `Expr`
values and SQL strings:
```ts
import { col } from "@lancedb/lancedb";
const rows = await table
.query()
.select({
id: "id",
name: col("firstName"),
total: col("unitPrice").mul(col("quantity")),
})
.toArray();
```
This works on every query with `select()`: `query()`, `vectorSearch()`,
`search()` and the take queries. The parameter type is now `Map<string,
string | Expr>` and `Record<string, string | Expr>`. Nothing else in the
TypeScript API changes.
### How it works
`select()` turns each `Expr` into SQL with `toSql()` and passes the
pairs to the native `select` that SQL strings already use. `where()`
handles an `Expr` the same way, so Node treats expressions alike in both
places. `toSql()` quotes camelCase names and SQL keywords with
backticks, so `col("firstName")` reads `firstName`.
I also looked at passing the expressions to Rust as `Select::Expr`, as
Python's `select_expr` does. I didn't go that way:
- Before a local or remote query runs, Rust turns `Select::Expr` back
into SQL with the same `expr_to_sql_string`. The query is the same
either way.
- A map that mixes SQL strings and expressions can't become a
`Select::Expr` without parsing the strings. Python's `AsyncQuery.select`
sends a mixed dict through `select_expr` and wraps each string with
`lit()` (`_coerce`), so `select({"id": "id", "doubled": col("score") *
lit(2)})` returns the string `'id'` in the `id` column. Sending SQL
keeps every string a SQL expression.
- I found one path that accepts `Select::Expr` and rejects
`Select::Dynamic`: namespace `QueryTable` pushdown. Node can't turn
pushdown on today, so nothing changes yet. If Node gets that option,
`select()` can send `Select::Expr` when every value is an `Expr`.
`blobMode: "bytes"` (#4353) finds blob columns by name in the `[output,
source]` list of the selection. For a camelCase column, `toSql()` gives
`` `imageData` ``, which doesn't match `imageData`. So when an `Expr` is
a bare column reference, the match uses its plain name. For this, the
native `Expr` gets a small `columnName()` helper, like `column_name()`
in the Python bindings, which Python uses for the same match. A blob
renamed with `col()` gets its bytes, as with a SQL string. Other
expressions are not filled with bytes, as before.
A value that is neither a string nor an `Expr` now throws a `TypeError`
that names the key, instead of the native conversion error.
### Tests
New tests in `expr.test.ts`:
- a `Map` that mixes SQL strings with `col("firstName")` and
`col("unitPrice").mul(2)` on a plain query, with the column order
- a `Record` with `upper()`, `func("lower", ...)` and a SQL string,
filtered with an `Expr` in `where()`
- `Expr` values on a vector query, an automatic `search()` (full-text
search) and a take query
- `blobMode: "bytes"` with a camelCase blob column selected with
`col()`: renamed, next to a computed `Expr` column, and in a take query
- a number as a value throws a `TypeError`
The whole Node suite passes. The Node docs under `docs/src/js` are
regenerated. The `@example` in the middle of the `select()` docstring
used to swallow the two paragraphs after it into the code block, so I
moved the example to the end, which is why each query class page
changes.
Left out: `Expr` items in the plain column list (`select([col("a")])`),
because an expression needs an output name. The `select` of a
materialized view still takes SQL strings only.
## Why
Hybrid search normalizes FTS scores with min-max. When all FTS scores
are equal (one match, or a tie), the range is 0 and every score became
0. `LinearCombinationReranker` treats 0 as a missing FTS match. So a
lone keyword match could rank below documents without the keyword. Fixes
#4857.
## What changed
- `_normalize_scores` takes a `tie_value` for the zero-range case. The
default stays 0, so vector distances are unchanged.
- The FTS leg passes `tie_value=1.0`, so tied FTS matches count as the
best FTS result.
## Scope
- Covers the zero-range case for both `normalize="score"` and
`normalize="rank"`.
- Leaves out how `_rank` breaks ties among equal scores. That is a
separate question.
## Blast Radius
The change only affects hybrid queries where every FTS hit has the same
score. RRF and MRR use list position, so their results don't change.
LinearCombination and custom score-based rerankers now give those hits
full FTS weight.
## Verification
- A new test in `test_hybrid_query.py` fails on main in both normalize
modes and passes with the fix.
- `pytest python/tests -m "not slow and not s3_test"`: 3272 passed, 167
skipped.
- `ruff format --check` and `ruff check` (0.9.9, the version pinned by
pre-commit) pass.
Local `merge_insert` skipped the mutability check, allowing a
version-pinned handle to commit onto its branch's latest version. Add
`ensure_mutable()` at the start of `NativeTable::merge_insert` so it
returns the same `InvalidInput` error as other writes before processing
the merge. This shared Rust path serves both Python and TypeScript local
tables.
Extend the existing branch-version and time-travel tests to cover pinned
opens and checkouts on main and named branches. Assert that rejection
preserves pinned data and the latest version, and that
`checkout_latest()` restores merge writes.
Validation:
- Both regression tests failed before the fix, reproducing successful
commits from pinned handles.
- Table tests: 405 passed (`cargo test --quiet --locked --profile ci
--features remote -p lancedb --lib table::tests::`).
- Merge tests: 20 passed (`cargo test --quiet --locked --profile ci
--features remote -p lancedb --lib table::merge::tests::`).
- `cargo clippy --quiet --locked --profile ci --features remote -p
lancedb --tests --examples` passed.
- `cargo fmt --all` and `git diff --check` passed.
Fixes#4844
<!-- lance-gatekeeper-fix:v1 agent=00c301b73fc482a11a5ccf15dea15981
generation=1 -->
<!-- gatefixer-walkthrough:v1
head=aa58a4d28a7596753bb44e3655d2839e07484398 -->
## Change walkthrough
```mermaid
flowchart LR
A["Native merge_insert"] --> B{"ensure_mutable"}
B -->|Pinned version| C["Return InvalidInput"]
B -->|Latest handle| D["Process merge"]
D --> E["Write data"]
```
**Read:** [Entry
guard](https://github.com/lancedb/lancedb/blob/aa58a4d28a7596753bb44e3655d2839e07484398/rust/lancedb/src/table.rs#L3972-L3986)
→ [Branch
pins](https://github.com/lancedb/lancedb/blob/aa58a4d28a7596753bb44e3655d2839e07484398/rust/lancedb/src/table.rs#L5141-L5158)
→ [Main pins and
reattachment](https://github.com/lancedb/lancedb/blob/aa58a4d28a7596753bb44e3655d2839e07484398/rust/lancedb/src/table.rs#L5488-L5518).
<sub>Snapshot:
[aa58a4d](https://github.com/lancedb/lancedb/commit/aa58a4d28a7596753bb44e3655d2839e07484398)</sub>
<!-- gatefixer-walkthrough:end -->
Co-authored-by: Gatefixer <313497061+lancedb-gatefixer[bot]@users.noreply.github.com>
Remote tag checkout discarded the tag's branch and pinned its version on
the handle's own branch without checking that the version existed. This
could read a different snapshot or leave the handle pinned to a
nonexistent version.
Resolve the complete tag reference and reject cross-branch tags with an
error naming both branches. For a tag on the handle's branch, reuse
numeric checkout to validate the version before committing the selector
and freshness state. This also protects Python's
`open_table(version=tag)`, which delegates to tag checkout. To read a
tag on another branch, obtain that branch's handle first with
`checkout_branch` in Rust or `table.branches.checkout(...)` in Python.
The Python checkout docstrings and tag-based versioning guide document
this requirement.
Add 17 regression cases covering cross-branch tags in both directions,
main-branch aliases, same-branch reads, and failed validation on
writable and pinned handles. Twelve cases failed against the original
implementation. Update the existing freshness and schema-cache tests for
the validation request.
Validation:
- `cargo test --locked --profile ci --features remote -p lancedb --lib
remote:: -- --quiet` — 921 tests passed using mocked remote endpoints.
- `cargo fmt --all` — passed.
- `cargo clippy --locked --profile ci --features remote -p lancedb
--tests --examples` — passed.
- Python documentation: Ruff lint and formatting checks passed for the
Python tree, using Ruff 0.15.20 from `python/uv.lock`. Python syntax
checks passed; executable ASTs are unchanged. Repository-wide `ruff
check .` reports 59 pre-existing errors in six unchanged
`docs/web-tests` files; unrelated formatter changes were excluded.
Fixes#4843
<!-- lance-gatekeeper-fix:v1 agent=2253a7bdebba53465089b95bce66cb12
generation=1 -->
<!-- gatefixer-walkthrough:v1
head=35f8db881e36b83b9aab478cb5db72e485c9eca7 -->
## Change walkthrough
```mermaid
flowchart TD
resolve["Resolve tag reference"] --> branch{"Same branch?"}
branch -->|No| reject["Return branch error"]
branch -->|Yes| validate["Describe tag version"]
validate -->|Error| error["Return version error"]
validate -->|Success| pin["Pin validated snapshot"]
```
The selector and freshness state commit together under the version lock.
**Read:** [branch
guard](https://github.com/lancedb/lancedb/blob/35f8db881e36b83b9aab478cb5db72e485c9eca7/rust/lancedb/src/remote/table.rs#L4075-L4092)
→ [validation and
commit](https://github.com/lancedb/lancedb/blob/35f8db881e36b83b9aab478cb5db72e485c9eca7/rust/lancedb/src/remote/table.rs#L2865-L2893)
→ [tag and branch
guidance](https://github.com/lancedb/lancedb/blob/35f8db881e36b83b9aab478cb5db72e485c9eca7/docs/web/management/table.mdx#L1745-L1755).
<sub>Snapshot:
[35f8db8](https://github.com/lancedb/lancedb/commit/35f8db881e36b83b9aab478cb5db72e485c9eca7)</sub>
<!-- gatefixer-walkthrough:end -->
---------
Co-authored-by: Gatefixer <313497061+lancedb-gatefixer[bot]@users.noreply.github.com>
Add `Table.openBlobFile` and `Table.openBlobFiles` for source-bearing
SQL `blob_descriptor` results, matching the existing Rust and Python
APIs.
The TypeScript methods forward the descriptor to the shared Rust opener
instead of reimplementing routing. That keeps the 10 MiB direct-read
threshold, pinned snapshot identity, resolver refresh, and 503
single-shot proxy fallback identical to `fetchBlobFiles` and the other
public Blob V2 entries. Descriptor fields remain the snake_case shape
returned by Arrow/SQL; the wrapper converts unsigned 64-bit values to
`bigint` at the NAPI boundary and returns `null` for null descriptors.
Existing custom `Table` subclasses keep working through a default "not
supported" implementation.
Validation:
- `pnpm tsc`
- `pnpm lint`
- `pnpm test --runInBand __test__/blob_open.test.ts
__test__/blob_ranges.test.ts __test__/remote_blob_snapshot.test.ts` — 65
passed
- focused Rust core tests for direct opens, threshold routing, snapshot
preservation, and 503 fallback — passed
The docs also update the TypeScript cross-row range table and example;
`fetchBlobRanges` was already implemented but was still documented as
unavailable.
The docs workflow uploads `github-pages` and deploys in the same job. On
`0adfd22`, attempt 1 finished the upload and the deploy immediately
found zero artifacts; attempt 2 uploaded again and the deploy found two
artifacts with the same name. Four earlier main runs show the same
zero-artifact race.
This uploads the site as `github-pages-<run_id>-<run_attempt>`, exposes
that name as a `build` job output, and deploys from a separate `needs:
build` job using the same name. A full workflow re-run gets a fresh
name, while a deploy-only retry keeps the original build output and
reuses the artifact uploaded by that build.
The existing action pins already expose the required inputs (`name` on
`upload-pages-artifact`, `artifact_name` on `deploy-pages`), so this
does not bump actions. Workflow triggers, permissions, concurrency, docs
build steps, and the Pages environment URL are unchanged.
Validation: `actionlint .github/workflows/docs.yml`, YAML parsing, and
`git diff --check` pass locally. Hosted checks run on this PR; the
actual Pages upload and deploy are verified on main after merge because
the workflow only deploys from `main`.
Evidence:
- [attempt
1](https://github.com/lancedb/lancedb/actions/runs/45805006874/job/139857949931):
upload succeeded, deploy logged `Found 0 artifact(s)`.
- [attempt
2](https://github.com/lancedb/lancedb/actions/runs/45805006874/job/139875545904):
upload succeeded, deploy logged `Found 2 artifact(s)` and failed with
`Multiple artifacts named "github-pages" were unexpectedly found`.
- Earlier main runs with the same zero-artifact result:
[45724226049](https://github.com/lancedb/lancedb/actions/runs/45724226049),
[45706607284](https://github.com/lancedb/lancedb/actions/runs/45706607284),
[45700962558](https://github.com/lancedb/lancedb/actions/runs/45700962558),
[45687315855](https://github.com/lancedb/lancedb/actions/runs/45687315855).
Python callers inspecting a pinned Function version lose the explicit
primary package index URL even when the server includes it. Preserve
`runtime.environment.build.index_url` through `get_function` and
canonical JSON.
The requested build view contains only the explicit primary URL. Extra
indexes, other sources, and service defaults can still apply when that
view is absent. Compare the server's `runtime_digest` with the authored
runtime's digest for identity. The inspection view can omit inputs to
that digest.
Typed registration rejects nonempty build settings before issuing a
request. The existing decorator options and `refresh_lock` use the same
registration path.
Loopback Flight tests exercised sync and async pinned reads with a
primary index plus an extra index, and with only an extra index. They
also verified that typed submission rejects unsupported settings before
sending a request and still submits ordinary decorator definitions with
`refresh_lock`. A separate local replay verified pinned readback against
a published version with a credential-free primary index. The focused
suites passed 547 Python and 129 Rust tests, with three Rust tests
marked ignored.
Opening a table by URI and then checking out a retained version requires
the latest manifest to be readable. A caller that persisted a version
can now open that snapshot directly with
`NativeTable::open_at_version(uri, name, version, params)`. The caller’s
`ReadParams` apply during the open, and the returned table is pinned
with the usual read-only checkout semantics.
The regression covers reopening a retained version after a later
manifest becomes unreadable.
Bump the Rust workspace and Java Lance dependencies to [Lance
v15.1.0-beta.2](https://github.com/lance-format/lance/releases/tag/v15.1.0-beta.2)
and pin the matching `pylance` beta in the Python test extra.
Raise the Rust toolchain and minimum supported version to 1.98.0 as
required by Lance, and address the new Clippy diagnostics.
Co-authored-by: Xuanwo <github@xuanwo.io>
## What
Fix the refresh path for direct Blob handles opened from a SQL
`blob_descriptor`.
`open_blob_file` acquired the resolver's immutable snapshot identity,
but the `PresignedBlobRangeRequester` used
`blob_locations_context_for_source`, which only copied the table
handle's `expected_query_snapshot`. For an ordinary table handle that is
`None`, so a provider credential expiry and refresh could establish a
different identity at the same numeric version. The refreshed handle
could then accept replacement-table bytes.
The refresh context now carries the identity acquired by the first
resolver response, matching the whole-read, range-read and
`fetch_blob_files` paths.
## Coverage
Adds five focused tests through the normal `open_blob_file` entrypoint:
- proactive refresh inside the 30s expiry skew before any object GET;
- provider credentials expiring earlier than the advertised URL TTL
(far-future `expires_at`, object store returns 403);
- single-shot re-resolution: a second 403 after refresh fails without a
third resolver call;
- renewal with a different snapshot identity is rejected before
accepting bytes;
- renewal resolver `403` propagates as an auth failure.
Existing `direct_blob_file_refreshes_expired_url_once` covered only
reactive refresh with no advertised expiry.
## Signer contract
The SDK treats object-store `401`/`403` as expiry and refreshes once. If
the resolver signs the refreshed URL with still-expired provider
credentials, the second object GET fails and the SDK fails closed.
Signers should return an `expires_at` no later than the underlying
credential expiry and use renewed credentials on re-resolution.
## Validation
- `cargo test -p lancedb --quiet --features remote --lib
remote::table::blobs::tests`: 70 passed.
- `cargo check -p lancedb --quiet --features remote --tests`: run before
the final test pass.
- No Sophon signer or cloud resource changes.
Python users can install the LanceDB SDK today. This adds a separate
`lancedb-tools` distribution so they can also run the standalone
`lancedb` CLI with `uvx` or install it with `pipx`. The wheels bundle
the same binaries shipped through GitHub Releases for Apple Silicon
macOS, Linux ARM64, and Linux x86-64. The workflow uploads the wheels to
GitHub Actions for testing. PyPI publication will wait for a stable
release.
This was accomplished with the following changes:
- Verify the release archives against `SHA256SUMS` and bundle each
binary with its license and third-party notices in a platform-specific
wheel.
- Add the `lancedb` entry point and document how to build and test
wheels from a release tag.
- Exercise each wheel with both `uvx` and `pipx` on a native runner.
### Testing
All six installation checks passed against `v0.42.0-beta.30` (Python
version `0.42.0b30`). On Apple Silicon macOS, Linux ARM64, and Linux
x86-64, both `uvx` and `pipx` reported `lancedb 0.42.0-beta.30` and
listed the built-in local profile. [Native test results and wheel
artifacts](https://github.com/lancedb/lancedb/actions/runs/45680764524)
Locally verified that all three wheels contain byte-for-byte copies of
the released binary and license notices. All 38 tests in `ci/tests`
discovered by Python unittest passed.
## What
Add a capability-gated client path for large Blob V2 reads over LanceDB
Enterprise:
- A successful `describe` advertises `x-lancedb-blob-locations: 1`; the
SDK then resolves pinned row locations through `POST
/v1/table/{id}/blob_locations/`.
- Whole reads (`fetch_blobs`) and seekable handles (`fetch_blob_files` /
`open_blob_file`) read presigned object-store URLs directly for eligible
values and ranges at or above a provisional internal 10 MiB threshold.
- Small ranges and `fetch_blob_ranges` stay on the existing proxy path,
including aggregate batches whose total exceeds the proxy byte limit.
- Shared `Packed` / `Managed` sidecars translate logical ranges to
physical offsets and validate the full numeric `Content-Range` tuple,
not just its start or total.
- Presigned traffic uses a separate HTTP client with no Enterprise
default headers, so service credentials never reach object storage.
- The first resolver response must carry a valid query-snapshot
identity. That identity is then required on every later partition and
preserved through object-URL refresh, proxy fallback and oversized
whole-value recovery. A resolver `503` falls back once to the proxy path
using any version and identity already pinned; other resolver errors
propagate. Object-store `503`s do not masquerade as resolver
unavailability.
- A read that starts without the capability reuses its supplied
`ReadSnapshot` if a later describe enables direct opening mid-operation.
- Version and query-snapshot pinning, NULL/order alignment and empty
values are preserved.
## Client network requirement
On Enterprise clusters that enable direct Blob reads, large values and
individual ranges may be fetched from short-lived object-store URLs
instead of the LanceDB proxy. Clients then need network access to the
object-store endpoint, including private endpoint routing, DNS, TLS
trust and egress rules, in addition to the LanceDB endpoint. Small reads
stay on the LanceDB proxy.
## Why
Large Blob V2 reads currently stream every payload byte through `Object
Store -> Plan Executor -> Query Node -> client`. That consumes internal
bandwidth, inflates PE/QN memory use and pollutes executor caches with
low-locality `.blob` data. This is the SDK half of ENT-4358; the server
implementation is in Sophon.
## Compatibility
No public SDK signatures change. Old clusters omit the capability header
and keep the existing proxy behaviour with zero extra round trips. The
10 MiB threshold is an internal prototype choice pending the paired
acceptance measurement; it is not a public knob.
## Validation
- `cargo check -p lancedb --quiet --features remote --tests` passes.
- `cargo test -p lancedb --quiet --features remote --lib
remote::table::blobs::tests` passes: 65 tests.
- New coverage includes direct whole reads, shared-sidecar physical
offsets and Content-Range rejection, small-range proxy routing, mixed
large/small range batches, resolver `503` fallback with pinned state, no
second resolver after fallback, object-store `503` not triggering proxy
fallback, missing/mismatched resolver identity rejection, resolver
identity preservation through refresh/proxy/oversized recovery,
supplied-snapshot reuse on mid-operation capability refresh, and
NULL/order/null-preserving paths.
A real-QN acceptance run with the candidate SDK binary is separate and
still pending deployment of the candidate server image.
Supersedes #4263, which I can no longer push to. This PR continues the
same branch, so the review history is there.
## Summary
Adds two-phase shuffled reads (2PSR) to `StreamingDataset`, enabled with
`block_size`:
1. **Block shuffle:** contiguous blocks of `block_size` live rows are
shuffled and assigned to splits. This replaces 1-phase's per-row take
with mostly contiguous range scans, which are much cheaper on object
storage.
2. **Bounded row shuffle:** each split shuffles rows over a rolling
window of `window_blocks` blocks. `max_shuffle_distance` bounds how far
a row can move.
The feature also supports `filter` (sparse takes of live rows),
`reshuffle_blocks_per_epoch`, resume and checkpointing, background block
prefetch, and multi-worker DataLoaders. 2PSR stays opt-in:
`block_size=None` keeps today's 1-phase behavior.
Since the last review round:
- **Fixed worker startup with small blocks.** The pickled dataset no
longer grows with the number of blocks; the block order is rebuilt in
`__setstate__`. Once that pickle passed the 64 KiB pipe buffer, spawned
DataLoader workers started one at a time (~280 s with 128 workers at
≤2,048-row blocks).
- **Fixed per-call block copies.** Each loaded block is combined into a
single chunk. Before, `take` on a multi-chunk block concatenated the
whole block on every call.
- **Fixed early eviction.** Blocks are evicted only behind the
contiguous prefix of rows already served. With `io_queue_depth > 1`,
calls can arrive out of order and previously evicted blocks that were
still needed, causing 5–40% extra reads.
- **New default:** `window_blocks` now defaults to 8, and the docstring
recommends `block_size=512` with DataLoader workers.
None of these fixes changes which rows are read or their order. A check
across 12 config, epoch and seed combinations on 8 ranks gave identical
per-rank order before and after.
## Benchmarks
Throughput was measured on EC2 i4i.32xlarge in us-west-2, reading a
FineWeb-Edu table of 4,096 B rows. Each number is the median of 3
trials, and each trial is a full pass. 2PSR used 512-row blocks, 256
splits, 128 workers and `io_queue_depth=4`. 1-phase used 32 splits, 8
workers and `io_queue_depth=32`.
| Storage | Rows | 2PSR | 1-phase | Speedup |
|---|---|---|---|---|
| S3 | 8.4M (34 GB) | 16.9 s | 230 s | 13.6× |
| S3 | 33.6M (137 GB) | 45.6 s | 781 s | 17.1× |
| S3 | 134M (550 GB) | 168 s | 3,098 s | 18.4× |
| Local NVMe | 8.4M | 16.4 s | 116 s | 7.1× |
On the 8.4M-row S3 table, 2PSR reads 1.5–2.0 GB/s at every block size
from 128 to 65,536 rows. A fit across the three S3 sizes gives 2PSR
about 7 s fixed cost plus 3.4 GB/s, and 1-phase about 39 s plus 0.18
GB/s. That puts the large-table limit near 19×.
Quality was measured by pretraining GPT-2 124M on 2^21 FineWeb-Edu docs
for 16 epochs on 8×H100. The table shows final validation loss, mean ±
SD over 3 seeds:
| Reader | Final val loss |
|---|---|
| 1-phase | 2.8464 ± 0.0006 |
| 2PSR, `block_size=128`, msd 4,096 | 2.8457 ± 0.0011 |
| 2PSR, `block_size=512`, msd 4,096 | 2.8457 ± 0.0007 |
| 2PSR, `block_size=2048`, msd 32,768 | 2.8466 ± 0.0009 |
| No shuffle (1 seed) | 2.8606 |
Every 2PSR config is within seed noise of 1-phase. The 95% confidence
intervals of the difference all include zero and are at most 13% of the
no-shuffle penalty. Training throughput was the same for every reader
(3.15–3.18M tok/s, GPU-bound).
## Testing
- `test_elastic_dataloader.py` and `test_permutation.py`: all 324 tests
pass after merging `main`. The new tests cover:
- pickle size independent of block count;
- single-chunk blocks;
- no re-reads under out-of-order calls;
- window defaults;
- resume, filter, worker and checkpoint behavior.
- `ruff check` and `ruff format --check` are clean.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Xuanwo <github@xuanwo.io>
TypeScript callers can now inspect and recover Function row failures
through the native workflow. `functionErrors()` groups returned failures
and can show retained attempt history. `functionErrorRows()` looks up
current failed inputs using row IDs and physical row addresses
represented as `bigint`. Older deployments can continue to use the
existing error listing.
`retryFailed()` selects the exact failed rows on the server, with
optional error type and job filters. `upgradeColumn()` binds an existing
immutable Function version and can recompute failed rows, all eligible
rows, or no rows. Callers can quarantine and release failures,
explicitly include quarantined rows in a retry, and use
`functionProvenance()` to see which Function version produced a recorded
value.
The native operations reuse the existing Rust workflow v1 capability
checks. The Function failures guide includes TypeScript examples for
inspecting, retrying, upgrading, and quarantining failures.
Allow Python callers to pass several registered Function applications to
`add_columns`. Rust callers can use `function_bindings` to submit the
same atomic declaration. An application can consume another output in
the mapping, including one declared later.
The SDK checks the Enterprise server's batch-declaration capability
before sending the mutation. Single-binding callers continue to use the
existing request shape. This change covers declaration only.
Coverage includes Python mapping validation, the Rust HTTP request with
dependent bindings, and older servers with missing or unknown capability
values. Correctness tests run in CI.
Bump the Rust Lance crates and Java lance-core to v15.0.0-beta.35, and
pin the Python tests to pylance 15.0.0b35. The Cargo and Python
lockfiles are refreshed for the [Lance
tag](https://github.com/lance-format/lance/tree/v15.0.0-beta.35).
### Summary
Adds `Permutation.map(fn, *, batched=False)`, a dict-based alternative
to `with_transform` so users can write `fn(dict) -> dict` without
touching `pyarrow.RecordBatch`.
- `batched=False` (default): `fn` receives one row as a dict and returns
a dict.
- `batched=True`: `fn` receives the batch as `dict[str, list]` and
returns the same shape, with one value per input row.
- `map` calls can be chained. Callbacks run in order and the returned
dict replaces the row, so the next callback only sees what the previous
one returned. Unlike HuggingFace's `Dataset.map`, the output is not
merged into the row.
- A mapped permutation always yields `list[dict]`, whatever `batched`
is, so it works with the default `DataLoader` collate. Rows keep their
position, including duplicate offsets, and `take_offsets([])` returns
`[]`.
- `map` cannot be combined with an explicit `with_format` or
`with_transform`, in either order. Doing so raises `ValueError` when the
chain is built, whether or not the format's optional dependency is
installed.
- `select_columns`, `remove_columns` and `schema` describe the columns
read from the base table, which are the input of the first callback.
- The chain is stored in a module-level callable, so a mapped
permutation can be pickled into `spawn` `DataLoader` workers as long as
the callbacks themselves are picklable.
- `with_transform` remains available for direct Arrow access.
### Documentation
- Docstrings for `map`, `with_format` and `with_transform` cover the
mixing rule, with a `DataLoader` + `collate_fn` example on `map`.
- Adds a "Transforming rows with map" section to the Permutation guide.
### Testing
- `test_permutation.py`: chaining, mixing errors in both orders, output
validation, duplicate and empty offsets, projection and schema, and a
pickle round-trip for both `batched` modes.
- `test_permutation.py`: the mixing check with `polars` unimportable,
with pickles written before the `explicit_transform` flag, and with a
transform passed to the constructor.
- `test_torch.py`: a map chain read through `DataLoader(...,
multiprocessing_context="spawn", num_workers=1)`.
Closes [#3246](https://github.com/lancedb/lancedb/issues/3246)
## Why
The "Configure Distance Metric" section of
`docs/web/search/vector-search.mdx` says `hamming` is supported for
`IVF_FLAT` indexes only. That contradicts the runnable binary-vector
example on the same page, which searches packed binary vectors with
`distance_type("hamming")` and no index. A reader could think they must
build an index before using Hamming distance.
## What changed
- Say that `hamming` works for binary vectors without an index.
- Keep the note that `IVF_FLAT` is the index type for indexed Hamming
search.
## Scope
Docs only: one sentence in the evergreen user guide. The same wording
also appears in the saved Embedded v0.41.0 and Enterprise v1.12.0,
v1.13.0 and v1.14.0 doc editions. I left those alone in case maintainers
handle saved-edition corrections differently.
## Verification
- Ran the website's binary-vector example test and both SDK
binary-vector tests against the published `lancedb==0.41.0` wheel: `3
passed`. They confirm that unindexed Hamming search works.
- `git diff --check` is clean. I did not render the page locally.
This PR was prepared with AI assistance and reviewed before submission.
Materialized-view create and refresh could return a registry handle for
a whitespace-only job ID. A trailing empty Arrow batch could also erase
`already_exists`, causing `CREATE MATERIALIZED VIEW IF NOT EXISTS` to
fail after the server had reported a successful no-op. This follows
#5175 and uses its single-row receipt logic for both operations.
- Read the one status row through the end of the Flight stream. Empty
batches may appear before or after it.
- Preserve valid job IDs verbatim. An empty ID with `already_exists`
completes create without a registry job. Refresh reports the create-only
status as an error.
- Use the existing query-backed handle when the server does not
advertise early materialized-view handles.
The public CLI guide covers the hosted installer, but users looking for
a Homebrew install have to find the tap themselves. This adds the tap's
install and upgrade commands alongside the shell installer. The shell
example shows how to pin a release to `v0.42.0`.
This was accomplished with the following changes:
- Add Homebrew installation, version verification, and upgrade commands
to `docs/web/tools/cli.mdx`.
- Give the shell installer its own subsection under the existing Install
heading.
### Testing
The shell installer tests passed. Verified that the install instructions
match the composed page in
[docs#475](https://github.com/lancedb/docs/pull/475).
## The problem
Several Python examples on Enterprise pages start a computed column
refresh with `table.refresh_column(...)`. On a LanceDB Enterprise
connection that call always fails:
```
NotImplementedError: not supported: a remote refresh runs as a server job; use refresh_column_async and wait on the returned handle
```
On Enterprise a refresh runs as a job on the server. Only
`refresh_column_async(...)` works there: it returns a job, and
`job.wait()` blocks until the job finishes. A reader following the
quickstart's Enterprise step, or the secrets or GPU examples, hits the
error. The same fix landed for the Sophon-owned page in
lancedb/sophon#10478.
## What this changes
- **The examples use the job form:** `job =
table.refresh_column_async(...)` then `job.wait()`. This covers
`curation/vend-secret.mdx`, `curation/create-function.mdx` and the
quickstart, plus the sentences that named the blocking call in
`enterprise/auto-refresh.mdx` and
`feature-engineering/add-computed-column.mdx`.
- **The quickstart example now comes from a test.** The
`PyQuickstartAddFeature` snippet is generated from the deployment test
in `docs/web-tests/py/test_quickstart.py`, and the separate
Enterprise-only snippet is folded into it. That test also asserts that
the blocking call raises an error naming `refresh_column_async`.
- **The GPU example only shows arguments the Enterprise table accepts
today.** `gpu_class` and `gpu_count` are dropped from `add_columns`, and
`gpu_count` from the refresh call, with a one-sentence note. See "Python
wrapper gap" below.
## How it was checked
Every Enterprise call the changed pages show was run through the Python
SDK (0.42.0b26, built from this branch) against a local stand-in for an
Enterprise server that returns canned responses:
- `table.refresh_column("embedding")` raises the error above and sends
no request.
- `job = table.refresh_column_async("embedding"); job.wait()` submits a
refresh job and returns its result.
- `table.refresh_column_async("embedding", gpu_class="h100",
total_gpu_count=8).wait()` is accepted, and the server receives both GPU
options.
- The removed forms fail as expected: `gpu_count` on
`refresh_column_async`, and `gpu_class` or `gpu_count` on `add_columns`,
raise `TypeError: unexpected keyword argument`.
Also: the committed quickstart snippet matches what the generator
produces from the test, and the five changed pages render with no
blocking call in a local preview.
**Not run:** the quickstart deployment test itself. It needs a real
Enterprise deployment and is skipped without credentials, which CI does
not have. Registering a Function also needs a real deployment, so that
line of the GPU example was not exercised.
## Python wrapper gap (to be fixed separately)
The Python `RemoteTable.refresh_column_async` and
`RemoteTable.add_columns` do not accept `gpu_count`, and `add_columns`
also does not accept `gpu_class`. The Rust remote table supports these
GPU placement options, so this looks like an oversight in the Python
layer. This PR makes no SDK change. Once the wrapper passes them
through, the GPU example can show them again.
## Risk
Low. Docs and docs tests only.
## Pipeline
Updates from [git push
no-mistakes](https://github.com/kunchenguid/no-mistakes)
<!-- no-mistakes-pipeline-attestation:v1
{"head_sha":"11ac1a260e8825dd406dea4e839f2498309e843b","steps":[{"step":"intent","status":"completed"},{"step":"rebase","status":"completed"},{"step":"review","status":"completed"},{"step":"test","status":"completed"},{"step":"document","status":"completed"},{"step":"lint","status":"completed"},{"step":"push","status":"completed"},{"step":"pr","status":"running"},{"step":"ci","status":"pending"}],"live_validation":{"verdict":"go","live":7,"total":9}}
-->
<details>
<summary>✅ **Intent** - passed</summary>
✅ No issues found.
</details>
<details>
<summary>✅ **Rebase** - passed</summary>
✅ No issues found.
</details>
<details>
<summary>✅ **Review** - passed</summary>
✅ No issues found.
</details>
<details>
<summary>⚠️ **Test** - 2 infos</summary>
- ⚠️ `docs/web/curation/create-function.mdx:546` - Not confirmed live.
The new example calls `table.refresh_column_async("embedding",
gpu_class="h100", gpu_count=4, total_gpu_count=8)`, but
`RemoteTable.refresh_column_async` in
python/python/lancedb/remote/table.py (line 1280) has no `gpu_count`
parameter (only `gpu_class` and `total_gpu_count`), while the abstract
`Table` and `LanceTable` do. If that reading holds, the documented call
raises `TypeError: unexpected keyword argument 'gpu_count'` on
Enterprise. The blocking `RemoteTable.refresh_column` has the same gap,
so this predates the change, but the page still shows a call that may
not run. Decision needed: drop `gpu_count=4` from the example, or add
the parameter to the Enterprise table (an SDK change beyond this docs
change).
- ⚠️ The intent asked whether the docs change can be validated by
running code. In this run it could not: the SDK build did not finish in
the time budget and no Enterprise deployment credentials are available,
so the only test covering the changed quickstart snippet
(`test_quickstart_derived_feature_on_a_deployment`) skips. The prepared
driver script in the evidence directory exercises the three documented
calls against a localhost emulator once the SDK is built.
- ⚠️ live validation verdict: inconclusive (4 of 7 scenarios were driven
live against the product); untested: On an Enterprise connection
(localhost emulator, synthetic responses) the documented `job =
table.refresh_column_async("embedding"); job.wait()` completes,
and the old blocking `table.refresh_column(...)` raises
NotImplementedError naming refresh_column_async, On an Enterprise
connection the create-function.mdx example
`table.refresh_column_async("embedding",
gpu_class="h100", gpu_count=4, total_gpu_count=8)` is accepted
and submits a job, `test_quickstart_derived_feature_on_a_deployment`
passes against a real LanceDB Enterprise deployment
- Live validation: ⚠️ inconclusive - 4 of 7 scenarios driven live
against the product
| Scenario | Result | Live | Evidence |
| --- | --- | --- | --- |
| Reader opens the six changed docs pages in the local Mintlify preview
and sees the job form (`refresh_column_async` + `job.wait()`) with no
blocking `table.refresh_column(` call left | ✅ pass | live |
Rendered-page check output (artifact 'Rendered docs check') and
saved HTML under
~/.no-mistakes/evidence/01M85TWQ599ZJ5NQ0DBASSFT91/rendered |
| Reader follows the new `refresh_column_async` link on the
computed-column page and lands on the 'Run a refresh on
Enterprise' section | ✅ pass | live | Rendered add-computed-column
page links to /feature-engineering/refresh-column#async; the rendered
refresh-column page (HTTP 200) contains an element with
id="async" |
| Quickstart page still renders after the Enterprise-only snippet import
was removed, and its feature step shows the job form | ✅ pass | live |
quickstart returns HTTP 200; page payload contains `job =
table.refresh_column_async("quality_score")\njob.wait()`; no
`PyQuickstartAddFeatureEnterprise` reference remains |
| Regenerating snippets from docs/web-tests/py/test_quickstart.py
reproduces the committed `PyQuickstartAddFeature` snippet | ✅ pass |
live | `mdx_snippets_gen.py` output in
~/.no-mistakes/evidence/01M85TWQ599ZJ5NQ0DBASSFT91/snippets-regen/quickstart.mdx
is identical to docs/web/snippets/quickstart.mdx for that export |
| On an Enterprise connection (localhost emulator, synthetic responses)
the documented `job = table.refresh_column_async("embedding");
job.wait()` completes, and the old blocking `table.refresh_column(.… |
⏸️ untested | no | Needs the Python SDK built from this worktree. `uv
run ... maturin develop` started from a cold cargo cache and was still
compiling after about 18 minutes, so I stopped it to stay inside the
30-minute… |
| On an Enterprise connection the create-function.mdx example
`table.refresh_column_async("embedding",
gpu_class="h100", gpu_count=4, total_gpu_count=8)` is accepted
and submits a job | ⏸️ untested | no | Blocked by the same unfinished
SDK build. The source suggests this call would raise TypeError (see
finding), but that was not executed. |
| `test_quickstart_derived_feature_on_a_deployment` passes against a
real LanceDB Enterprise deployment | ⏸️ untested | no | The test skips
unless LANCEDB_DOCS_TEST_DEPLOYMENT=1 and LANCEDB_URI,
LANCEDB_HOST_OVERRIDE and LANCEDB_API_KEY point at a deployment with a
Function catalog; a localhost emulator cannot stand in for… |
- <code>`cd docs/web && mint dev --port 3391 --no-open`, then
`curl http://localhost:3391/<page>` for quickstart,
curation/vend-secret, curation/create-function, enterprise/auto-refresh,
feature-engineering/add-computed-column,
feature-engineering/refresh-column (all HTTP 200), with a text check of
each rendered page</code>
- <code>`python3 docs/web-tests/mdx_snippets_gen.py -s docs/web-tests/py
-s docs/web-tests/ts -s docs/web-tests/rs -o
<evidence>/snippets-regen`, then diff of `PyQuickstartAddFeature`
against `docs/web/snippets/quickstart.mdx`</code>
- <code>`cd python && uv run --extra tests --extra dev maturin
develop --extras tests,dev` (started, not finished within budget,
stopped; no result)</code>
- <code>`chrome-devtools-axi` screenshots of the rendered pages (failed:
BRIDGE_NOT_READY)</code>
- <code>Source read of `python/python/lancedb/remote/table.py`
`refresh_column_async` signature against the create-function.mdx example
(not live)</code>
🔧 Fix applied.
2 infos still open:
- ℹ️ No screenshots of the rendered docs pages were captured.
`chrome-devtools-axi` failed with "Bridge failed to start within
30s" and headless Google Chrome hung until killed at 60s per page.
The pages were instead fetched as served HTML from a local `mint dev`
preview and saved under rendered-round2/. For the quickstart page the
job-form snippet is present only in the page's hydration payload,
not as rendered text, so its on-screen appearance was not seen.
- ℹ️ `docs/web-tests/py/test_quickstart.py:347` -
`test_quickstart_derived_feature_on_a_deployment`, the only test that
runs the changed quickstart snippet end to end, skips because no
Enterprise deployment credentials exist (LANCEDB_DOCS_TEST_DEPLOYMENT,
LANCEDB_URI, LANCEDB_HOST_OVERRIDE, LANCEDB_API_KEY). The same calls
were driven against a localhost emulator instead, which does not prove
real-deployment behaviour.
- Live validation: ✅ go - 7 of 9 scenarios driven live against the
product
| Scenario | Result | Live | Evidence |
| --- | --- | --- | --- |
| On an Enterprise connection (Python SDK, localhost emulator, synthetic
responses) the documented `job =
table.refresh_column_async("embedding"); job.wait()` submits a
refresh job and returns its resul… | ✅ pass | live |
driver-output-round2.txt: OK -> rows_assigned=3 ...; server received
POST /v1/table/test/backfill_column {'column':
'embedding'} |
| Adversarial: on the same Enterprise connection the old blocking
`table.refresh_column("embedding")` fails with
NotImplementedError naming refresh_column_async and sends no request | ✅
pass | live | driver-output-round2.txt: RAISED NotImplementedError: ...
use refresh_column_async and wait on the returned handle; requests sent:
[] |
| The create-function.mdx refresh example as now written,
`refresh_column_async("embedding", gpu_class="h100",
total_gpu_count=8)` then `job.wait()`, is accepted on Enterprise and
sends both GPU options | ✅ pass | live | driver-output-round2.txt:
server received {'gpu_class': 'h100',
'total_gpu_count': 8, 'column': 'embedding'} |
| The create-function.mdx `table.add_columns({"embedding":
<Function binding>}, total_gpu_count=8)` is accepted on Enterprise
and sends the fleet GPU ceiling | ✅ pass | live |
driver-output-round2.txt: OK -> AddColumnsResult(version=2); POST
/v1/table/test/add_columns/ body carries the Function binding and
'total_gpu_count': 8 |
| Adversarial: the GPU arguments removed from the create-function.mdx
example (`gpu_count` on refresh_column_async; `gpu_class`/`gpu_count` on
add_columns) are rejected by the Enterprise table, matching… | ✅ pass |
live | driver-output-round2.txt: TypeError unexpected keyword argument
'gpu_count' (refresh_column_async) and 'gpu_class'
(add_columns) |
| The committed `PyQuickstartAddFeature` snippet equals what the snippet
generator produces from docs/web-tests/py/test_quickstart.py | ✅ pass |
live | `mdx_snippets_gen.py` output in snippets-regen-round2; `diff -r`
against docs/web/snippets reports no difference for quickstart.mdx |
| A reader opening the five changed pages in a local Mintlify preview
sees the job form and no blocking `table.refresh_column(` call | ✅ pass
| live | rendered-round2-counts.txt and rendered-round2/*.html: all five
pages return 200 with zero blocking calls; job form present on each |
| `test_quickstart_derived_feature_on_a_deployment` passes against a
real LanceDB Enterprise deployment | ⏸️ untested | no | Ran the test; it
skips because no Enterprise deployment credentials exist here. A
localhost emulator cannot stand in: the test registers a Function over
Flight SQL and computes real values. To run it,… |
| `version = db.create_function(embed)` from the create-function.mdx
example registers a Function on Enterprise | ⏸️ untested | no | Tried it
against the emulator; the call goes over Flight SQL to a Function
catalog, which only a real Enterprise deployment provides. This line is
unchanged by the diff. Needs the same deployment cred… |
- <code>`~/.treehouse/lancedb-9ea8c9/1/lancedb/python/.venv/bin/python
drive_enterprise_refresh_v3.py` (lancedb 0.42.0b26 built at cb082c08,
whose SDK source is identical to this head; Enterprise connection to a
localhost emulator with synthetic responses)</code>
- <code>`python docs/web-tests/mdx_snippets_gen.py -s docs/web-tests/py
-s docs/web-tests/ts -s docs/web-tests/rs -o
<evidence>/snippets-regen-round2` then `diff -r` against
`docs/web/snippets` (quickstart.mdx identical)</code>
- <code>`cd docs/web-tests/py && python -m pytest
test_quickstart.py -q -rs` (4 passed, 6 skipped; all skips are
deployment-only tests)</code>
- <code>`mint dev --port 3397` in docs/web, then `curl` of /quickstart,
/curation/vend-secret, /curation/create-function,
/enterprise/auto-refresh, /feature-engineering/add-computed-column (all
200) and a count of blocking vs job-form calls in the served HTML</code>
- <code>`git status --short` after teardown (clean; preview stopped,
port 3397 free)</code>
</details>
<details>
<summary>✅ **Document** - passed</summary>
✅ No issues found.
</details>
<details>
<summary>⚠️ **Lint** - 1 info</summary>
- ℹ️ `docs/web-tests/py/test_quickstart.py:29` - `ruff check` reports
C408 (`dict()` call, rewrite as a literal) in the `deployment` fixture.
It is on a line this change did not touch and is also present at the
base commit; ruff's only fix for it is marked unsafe, so I left it.
`ruff format --check` passes. ruff is not on PATH, so I ran it through
`uvx`, which may not be the repo-pinned version.
</details>
<details>
<summary>✅ **Push** - passed</summary>
✅ No issues found.
</details>
Stable CLI releases already publish three binary archives and their
checksums, but a maintainer would have to copy those checksums into the
Homebrew formula for every release. This adds a job that opens a PR in
the tap after GitHub publishes a stable release. Tap CI tests the
published binaries and a maintainer merges the update. Before the first
automated update, merge the initial [stable
formula](https://github.com/lancedb/homebrew-tap/pull/1) and configure
the GitHub App as described in `release_process.md`.
This was accomplished with the following changes:
- Read `SHA256SUMS` from the published tag and update the formula
version and the hash for each matching platform archive.
- Use a tap-scoped App token and a branch per release so retries update
the same PR. Older release retries preserve newer formula versions.
### Testing
All 38 CI-script tests passed locally, including checksum mapping,
invalid or incomplete manifests, prerelease rejection, and retries. A
dry run against the actual draft formula with a simulated stable
manifest produced valid Ruby and a second run produced no changes. Live
App authentication and tap PR creation require the installation
credentials.
Compact and data PREWARM accepted whitespace-only job IDs that Cleanup
rejected. All three remote SDK commands now use the same Flight SQL
receipt reader to validate the registry ID before returning a job
handle.
This was accomplished with the following changes:
- Read through the end of the stream, retaining at most one candidate
row. Require exactly one row with a nonblank UTF-8 `job_id` and preserve
the ID as returned.
- Validate PREWARM’s additional non-null UInt64 table version and
preserve each command’s SQL error diagnostics.
- Build the handle from the registry ID without a status poll. A
malformed receipt tells the caller to inspect jobs before retrying,
since the server may already have accepted the submission.
## Summary
Follows up on #4005, which handled mixed batches in
`OpenAIEmbeddings.generate_embeddings`. On `main`, when the input batch
is empty (`[]`) or filtering leaves no valid texts (such as `[None,
""]`), `generate_embeddings` still imports the `openai` SDK and calls
`embeddings.create(input=[], ...)`.
- Return `[None] * len(texts)` early in
`python/python/lancedb/embeddings/openai.py` when no valid texts remain
(`[]` for empty input, one `None` per item when all inputs are
filtered), before importing the `openai` SDK or sending a request.
- Add regression tests in `python/python/tests/test_embeddings.py`
covering empty batches, all-filtered batches, and native-backed
`table.add(..., on_bad_vectors="null")` verifying rows are kept with
null vectors and no OpenAI request is made.
## Attribution
Successor to #3152. The early return and nullable ingestion test were
originally contributed by @saudademjj in #3152.
## Verification
- 3 new regression tests failed before the fix (observing
`embeddings.create(input=[], ...)`) and passed after.
- Related embedding test suite: `148 passed, 1 skipped, 9 deselected`
(mocked client only; no live OpenAI API calls).
- Ruff check and format checks are clean for the changed `python/` tree
(scoped to `python/` only).
Co-authored-by: saudademjj
<128795969+saudademjj@users.noreply.github.com>
Co-authored-by: saudademjj <128795969+saudademjj@users.noreply.github.com>
Closes#4933
Adds a generic configuration for creating a scalar index of any type
recognized by a registered database plugin, using its type name and
optional JSON parameters. Index types without a dedicated SDK
configuration can use the same API.
- **Rust:** `Index::Plugin(PluginIndexBuilder)`, with JSON-object
parameters through `.params(...)` or `.params_json(...)`.
- **Python:** `ScalarPlugin(index_type, params=None)`, accepting a dict
or JSON-object string.
- **TypeScript:** `Index.plugin(indexType, params?)`, accepting an
object or JSON-object string.
- Type names are case-insensitive and surrounding whitespace is ignored.
Empty names and non-object parameters are rejected.
- Native index introspection preserves existing built-in types and
exposes other registered plugin types through `Custom`.
The guide and SDK references describe index creation, parameter
ownership, and errors consistently. They recommend a dedicated
configuration when one exists and refer readers to the plugin’s
documentation for parameter names and defaults. The TypeScript reference
is regenerated from its source JSDoc.
## Remote request format
Generic requests use `index_type: "PLUGIN"` and a separate upper-cased
`plugin_type`. Arbitrary parameters stay nested under `params`,
preserving omitted parameters versus an explicit empty object. This
separates the generic path from built-in handling and prevents
parameters from overwriting request fields.
## Validation
- 52 targeted tests passed: 15 Rust, 22 Python, and 15 TypeScript.
- Two Rust plugin doctests passed.
- Rust Clippy, the Node build and lint, changed-file Python lint,
TypeDoc generation, Vale, and the MkDocs SDK-reference build passed.
- Request tests cover Python sync/async calls, object and JSON-string
inputs, normalization, omitted and empty parameters, and collisions with
request metadata.
- Repository-wide Ruff reports existing findings in untouched
documentation examples. Strict Mintlify validation reports four missing
snippet-export warnings, also reproduced on the unmodified commit.
## Follow-ups
- Replace the built-in examples with a widely available custom plugin
when one is available, as discussed in review.
- Remote `list_indices()` and `index_stats()` still parse a fixed set of
type names; accepting unrecognized plugin types through a `Custom`
fallback remains separate.
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>