mirror of
https://github.com/lancedb/lancedb.git
synced 2026-08-30 09:58:20 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cb6a1fafa6 |
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "lancedb",
|
|
||||||
"interface": {
|
|
||||||
"displayName": "LanceDB"
|
|
||||||
},
|
|
||||||
"plugins": [
|
|
||||||
{
|
|
||||||
"name": "lancedb",
|
|
||||||
"source": {
|
|
||||||
"source": "local",
|
|
||||||
"path": "./plugins/lancedb"
|
|
||||||
},
|
|
||||||
"policy": {
|
|
||||||
"installation": "AVAILABLE",
|
|
||||||
"authentication": "ON_INSTALL"
|
|
||||||
},
|
|
||||||
"category": "Developer Tools"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# Agent Skills
|
|
||||||
|
|
||||||
This directory contains repo-scoped code agent skills for the LanceDB project.
|
|
||||||
|
|
||||||
Each skill is a folder that contains a required `SKILL.md` and optional bundled resources.
|
|
||||||
|
|
||||||
Codex discovers skills from `.agents/skills` in the current working directory and parent directories.
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
---
|
|
||||||
name: lancedb-update-lance-dependency
|
|
||||||
description: Update LanceDB to a specific Lance release or tag. Use when bumping Lance dependencies in the lancedb repository, including Rust workspace Lance crates, Java lance-core, validation, branch creation, commit, push, and PR creation when requested.
|
|
||||||
---
|
|
||||||
|
|
||||||
# LanceDB Update Lance Dependency
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
|
|
||||||
Use this skill in the `lancedb/lancedb` repository when updating the Lance dependency to a specific Lance version or tag.
|
|
||||||
|
|
||||||
Inputs can be a version (`7.2.0-beta.1`), a tag (`v7.2.0-beta.1`), a tag ref (`refs/tags/v7.2.0-beta.1`), or `latest`.
|
|
||||||
|
|
||||||
## Workflow
|
|
||||||
|
|
||||||
1. Confirm the worktree status with `git status --short`.
|
|
||||||
2. Resolve the target Lance version:
|
|
||||||
|
|
||||||
- If the input is `latest`, empty, or omitted, run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python3 ci/check_lance_release.py
|
|
||||||
```
|
|
||||||
|
|
||||||
Parse the JSON output. If `needs_update` is not `true`, stop without creating a PR. Otherwise use `latest_tag`.
|
|
||||||
|
|
||||||
- If the input is explicit, use it directly.
|
|
||||||
|
|
||||||
3. Compute update metadata without changing files:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python3 ci/update_lance_dependency.py "$TAG_OR_VERSION" --metadata-only
|
|
||||||
```
|
|
||||||
|
|
||||||
Before making changes, check for an existing open PR with the emitted `pr_title`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
gh pr list --search "\"$PR_TITLE\" in:title" --state open --limit 1 --json number,url,title
|
|
||||||
```
|
|
||||||
|
|
||||||
If a matching open PR exists, stop and report it instead of creating a duplicate.
|
|
||||||
|
|
||||||
4. Run the deterministic update entrypoint:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python3 ci/update_lance_dependency.py "$TAG_OR_VERSION"
|
|
||||||
```
|
|
||||||
|
|
||||||
This updates the Rust workspace Lance dependencies through `ci/set_lance_version.py`, updates `java/pom.xml`, refreshes Cargo metadata, and prints JSON metadata containing `branch_name`, `commit_message`, and `pr_title`.
|
|
||||||
|
|
||||||
5. Run validation:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cargo clippy --quiet --workspace --tests --all-features -- -D warnings
|
|
||||||
cargo fmt --all --quiet
|
|
||||||
```
|
|
||||||
|
|
||||||
Fix real diagnostics and rerun clippy until it succeeds. Do not skip warnings.
|
|
||||||
|
|
||||||
6. Inspect `git status --short` and `git diff` to ensure only the Lance dependency update and required compatibility fixes are present.
|
|
||||||
|
|
||||||
7. If the task only asks to prepare local changes, stop here and report the changed files and validation result.
|
|
||||||
|
|
||||||
8. If the task asks to publish the update, create a branch using the printed `branch_name`, stage all relevant files, and commit using the printed `commit_message`. Do not amend or rewrite existing commits.
|
|
||||||
|
|
||||||
9. Push to `origin`. Before creating the PR, check that the current token has push permission:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
gh api repos/lancedb/lancedb --jq .permissions.push
|
|
||||||
```
|
|
||||||
|
|
||||||
If the remote branch already exists for the same generated branch name, delete the remote ref with `gh api -X DELETE repos/lancedb/lancedb/git/refs/heads/$BRANCH_NAME`, then push. Do not force-push.
|
|
||||||
|
|
||||||
10. Create a PR targeting `main` with the printed `pr_title`. If there is no PR template, keep the body to two or three concise sentences: state the Lance dependency bump, note any required compatibility fixes, and link the triggering Lance tag or release.
|
|
||||||
|
|
||||||
11. Read back the remote PR title after creation. If it is not a Conventional Commit title, fix it immediately.
|
|
||||||
|
|
||||||
12. When running in GitHub Actions after creating the LanceDB PR, trigger the Sophon dependency update:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
gh workflow run codex-bump-lancedb-lance.yml \
|
|
||||||
--repo lancedb/sophon \
|
|
||||||
-f lance_ref="$LANCE_TAG" \
|
|
||||||
-f lancedb_ref="$BRANCH_NAME"
|
|
||||||
gh run list --repo lancedb/sophon --workflow codex-bump-lancedb-lance.yml --limit 1 --json databaseId,url,displayTitle
|
|
||||||
```
|
|
||||||
|
|
||||||
Use the emitted metadata `tag` value as `LANCE_TAG`. Do this only after a new LanceDB PR has been created. If the update was skipped because no update is needed or an open PR already exists, do not trigger Sophon.
|
|
||||||
|
|
||||||
## GitHub Actions
|
|
||||||
|
|
||||||
When this skill is used from GitHub Actions, `TAG`, `GH_TOKEN`, and `GITHUB_TOKEN` may already be set. Resolve `latest` first when `TAG` is empty. Once an explicit tag or version is known, use:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python3 ci/update_lance_dependency.py "$TAG" --github-output "$GITHUB_OUTPUT"
|
|
||||||
```
|
|
||||||
|
|
||||||
Then use the emitted `branch_name`, `commit_message`, and `pr_title` values for branch, commit, and PR creation.
|
|
||||||
+1
-10
@@ -1,5 +1,5 @@
|
|||||||
[tool.bumpversion]
|
[tool.bumpversion]
|
||||||
current_version = "0.38.0-beta.13"
|
current_version = "0.30.0-beta.1"
|
||||||
parse = """(?x)
|
parse = """(?x)
|
||||||
(?P<major>0|[1-9]\\d*)\\.
|
(?P<major>0|[1-9]\\d*)\\.
|
||||||
(?P<minor>0|[1-9]\\d*)\\.
|
(?P<minor>0|[1-9]\\d*)\\.
|
||||||
@@ -23,8 +23,6 @@ allow_dirty = true
|
|||||||
commit = true
|
commit = true
|
||||||
message = "Bump version: {current_version} → {new_version}"
|
message = "Bump version: {current_version} → {new_version}"
|
||||||
commit_args = ""
|
commit_args = ""
|
||||||
# bump-my-version >=1.4.0 rejects pre_commit_hooks containing shell syntax unless opted in.
|
|
||||||
allow_shell_hooks = true
|
|
||||||
|
|
||||||
# Java maven files
|
# Java maven files
|
||||||
pre_commit_hooks = [
|
pre_commit_hooks = [
|
||||||
@@ -75,13 +73,6 @@ filename = "nodejs/Cargo.toml"
|
|||||||
replace = "\nversion = \"{new_version}\""
|
replace = "\nversion = \"{new_version}\""
|
||||||
search = "\nversion = \"{current_version}\""
|
search = "\nversion = \"{current_version}\""
|
||||||
|
|
||||||
# The Python package takes its version from here (pyproject.toml declares
|
|
||||||
# `dynamic = ["version"]`, so maturin reads it out of the crate manifest).
|
|
||||||
[[tool.bumpversion.files]]
|
|
||||||
filename = "python/Cargo.toml"
|
|
||||||
replace = "\nversion = \"{new_version}\""
|
|
||||||
search = "\nversion = \"{current_version}\""
|
|
||||||
|
|
||||||
# Java documentation
|
# Java documentation
|
||||||
[[tool.bumpversion.files]]
|
[[tool.bumpversion.files]]
|
||||||
filename = "docs/src/java/java.md"
|
filename = "docs/src/java/java.md"
|
||||||
|
|||||||
@@ -9,18 +9,6 @@ debug = true
|
|||||||
codegen-units = 16
|
codegen-units = 16
|
||||||
lto = "thin"
|
lto = "thin"
|
||||||
|
|
||||||
[profile.release-no-lto]
|
|
||||||
inherits = "release"
|
|
||||||
debug = true
|
|
||||||
lto = false
|
|
||||||
# Prioritize compile time when LTO is not relevant to the measurement.
|
|
||||||
codegen-units = 16
|
|
||||||
|
|
||||||
[profile.bench]
|
|
||||||
inherits = "release"
|
|
||||||
lto = "thin"
|
|
||||||
codegen-units = 16
|
|
||||||
|
|
||||||
[target.'cfg(all())']
|
[target.'cfg(all())']
|
||||||
rustflags = [
|
rustflags = [
|
||||||
"-Wclippy::all",
|
"-Wclippy::all",
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "lancedb",
|
|
||||||
"owner": {
|
|
||||||
"name": "LanceDB"
|
|
||||||
},
|
|
||||||
"description": "LanceDB plugins for Claude Code.",
|
|
||||||
"plugins": [
|
|
||||||
{
|
|
||||||
"name": "lancedb",
|
|
||||||
"source": "./plugins/lancedb",
|
|
||||||
"description": "Write, review, debug, and document LanceDB pipelines in Python and TypeScript that work across local LanceDB OSS tables and remote LanceDB Enterprise/Cloud tables.",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"author": {
|
|
||||||
"name": "LanceDB"
|
|
||||||
},
|
|
||||||
"category": "development"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -27,31 +27,19 @@ runs:
|
|||||||
# Extract failed job names
|
# Extract failed job names
|
||||||
FAILED_JOBS=$(echo "$JOB_RESULTS" | jq -r 'to_entries | map(select(.value.result == "failure")) | map(.key) | join(", ")')
|
FAILED_JOBS=$(echo "$JOB_RESULTS" | jq -r 'to_entries | map(select(.value.result == "failure")) | map(.key) | join(", ")')
|
||||||
|
|
||||||
TITLE="$WORKFLOW_NAME Failed ($FAILED_JOBS)"
|
# Create issue with workflow name, failed jobs, and run URL
|
||||||
|
gh issue create \
|
||||||
# This action now also runs on nightly schedules, so a breakage that
|
--title "$WORKFLOW_NAME Failed ($FAILED_JOBS)" \
|
||||||
# persists for a few days would otherwise file one issue per night.
|
--body "The workflow **$WORKFLOW_NAME** failed during execution.
|
||||||
# Comment on the open report instead when one already exists.
|
|
||||||
EXISTING=$(gh issue list --state open --label ci --limit 100 --json number,title \
|
|
||||||
| jq -r --arg title "$TITLE" 'map(select(.title == $title)) | .[0].number // empty')
|
|
||||||
|
|
||||||
if [ -n "$EXISTING" ]; then
|
|
||||||
gh issue comment "$EXISTING" --body "Failed again: $RUN_URL"
|
|
||||||
echo "Commented on existing issue #$EXISTING"
|
|
||||||
else
|
|
||||||
gh issue create \
|
|
||||||
--title "$TITLE" \
|
|
||||||
--body "The workflow **$WORKFLOW_NAME** failed during execution.
|
|
||||||
|
|
||||||
**Failed jobs:** $FAILED_JOBS
|
**Failed jobs:** $FAILED_JOBS
|
||||||
|
|
||||||
**Run URL:** $RUN_URL
|
**Run URL:** $RUN_URL
|
||||||
|
|
||||||
Please investigate the failed jobs and address any issues." \
|
Please investigate the failed jobs and address any issues." \
|
||||||
--label "ci"
|
--label "ci"
|
||||||
|
|
||||||
echo "Issue created successfully"
|
echo "Issue created successfully"
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "No job failures detected, skipping issue creation"
|
echo "No job failures detected, skipping issue creation"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -17,54 +17,7 @@ updates:
|
|||||||
# newer minimum versions.
|
# newer minimum versions.
|
||||||
versioning-strategy: lockfile-only
|
versioning-strategy: lockfile-only
|
||||||
groups:
|
groups:
|
||||||
# The arrow-rs and datafusion crates are released in lockstep and have to
|
|
||||||
# move together, so keep them in one PR instead of one per sub-crate.
|
|
||||||
# Listed first: a dependency joins the first group it matches.
|
|
||||||
arrow-datafusion:
|
|
||||||
patterns:
|
|
||||||
- arrow
|
|
||||||
- arrow-*
|
|
||||||
- parquet
|
|
||||||
- parquet-*
|
|
||||||
- datafusion
|
|
||||||
- datafusion-*
|
|
||||||
- object_store
|
|
||||||
rust-minor-patch:
|
rust-minor-patch:
|
||||||
update-types:
|
update-types:
|
||||||
- minor
|
- minor
|
||||||
- patch
|
- patch
|
||||||
|
|
||||||
- package-ecosystem: pip
|
|
||||||
directory: /python
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
# Only update uv.lock, never widen version requirements in pyproject.toml.
|
|
||||||
versioning-strategy: lockfile-only
|
|
||||||
groups:
|
|
||||||
python-deps:
|
|
||||||
patterns:
|
|
||||||
- "*"
|
|
||||||
|
|
||||||
# The npm ecosystem covers pnpm lockfiles. There are two separate installs:
|
|
||||||
# the bindings themselves and the examples, which have their own lockfile.
|
|
||||||
# As with cargo and pip above, only bump the lockfile — the version ranges
|
|
||||||
# in package.json are our consumers' constraints, not ours.
|
|
||||||
- package-ecosystem: npm
|
|
||||||
directory: /nodejs
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
versioning-strategy: lockfile-only
|
|
||||||
groups:
|
|
||||||
nodejs-deps:
|
|
||||||
patterns:
|
|
||||||
- "*"
|
|
||||||
|
|
||||||
- package-ecosystem: npm
|
|
||||||
directory: /nodejs/examples
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
versioning-strategy: lockfile-only
|
|
||||||
groups:
|
|
||||||
nodejs-examples-deps:
|
|
||||||
patterns:
|
|
||||||
- "*"
|
|
||||||
|
|||||||
@@ -18,14 +18,6 @@ inputs:
|
|||||||
description: "The manylinux version to build for"
|
description: "The manylinux version to build for"
|
||||||
required: false
|
required: false
|
||||||
default: "2_17"
|
default: "2_17"
|
||||||
package-name:
|
|
||||||
description: "Override [project] name in python/pyproject.toml (e.g. 'lancedb-compat'). Default keeps 'lancedb'."
|
|
||||||
required: false
|
|
||||||
default: "lancedb"
|
|
||||||
rustflags:
|
|
||||||
description: "RUSTFLAGS for the build container, as a single whitespace-free token (e.g. '-Ctarget-cpu=x86-64-v2'). Empty leaves RUSTFLAGS unset, keeping the defaults from .cargo/config.toml."
|
|
||||||
required: false
|
|
||||||
default: ""
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
@@ -35,18 +27,6 @@ runs:
|
|||||||
ARM_BUILD: ${{ inputs.arm-build }}
|
ARM_BUILD: ${{ inputs.arm-build }}
|
||||||
run: |
|
run: |
|
||||||
echo "ARM BUILD: $ARM_BUILD"
|
echo "ARM BUILD: $ARM_BUILD"
|
||||||
- name: Patch package name for variant build
|
|
||||||
if: ${{ inputs.package-name != 'lancedb' }}
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
PACKAGE_NAME: ${{ inputs.package-name }}
|
|
||||||
run: |
|
|
||||||
# Swap the [project] name so this build produces e.g. lancedb-compat
|
|
||||||
# wheels. The package still installs files under the lancedb/
|
|
||||||
# namespace -- import lancedb still works after pip install.
|
|
||||||
sed -i.bak 's/^name = "lancedb"$/name = "'"$PACKAGE_NAME"'"/' python/pyproject.toml
|
|
||||||
rm -f python/pyproject.toml.bak
|
|
||||||
grep '^name = ' python/pyproject.toml
|
|
||||||
- name: Build x86_64 Manylinux wheel
|
- name: Build x86_64 Manylinux wheel
|
||||||
if: ${{ inputs.arm-build == 'false' }}
|
if: ${{ inputs.arm-build == 'false' }}
|
||||||
uses: PyO3/maturin-action@v1
|
uses: PyO3/maturin-action@v1
|
||||||
@@ -54,16 +34,15 @@ runs:
|
|||||||
maturin-version: "1.12.4"
|
maturin-version: "1.12.4"
|
||||||
command: build
|
command: build
|
||||||
working-directory: python
|
working-directory: python
|
||||||
docker-options: "-e PIP_EXTRA_INDEX_URL='https://pypi.fury.io/lance-format/ https://pypi.fury.io/lancedb/' -e PROTOC=/usr/local/bin/protoc ${{ inputs.rustflags != '' && format('-e RUSTFLAGS={0}', inputs.rustflags) || '' }}"
|
docker-options: "-e PIP_EXTRA_INDEX_URL='https://pypi.fury.io/lance-format/ https://pypi.fury.io/lancedb/'"
|
||||||
target: x86_64-unknown-linux-gnu
|
target: x86_64-unknown-linux-gnu
|
||||||
manylinux: ${{ inputs.manylinux }}
|
manylinux: ${{ inputs.manylinux }}
|
||||||
args: ${{ inputs.args }}
|
args: ${{ inputs.args }}
|
||||||
before-script-linux: |
|
before-script-linux: |
|
||||||
set -e
|
set -e
|
||||||
curl -fsSL https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protoc-24.4-linux-x86_64.zip -o /tmp/protoc.zip
|
curl -L https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protoc-24.4-linux-$(uname -m).zip > /tmp/protoc.zip \
|
||||||
unzip /tmp/protoc.zip -d /usr/local
|
&& unzip /tmp/protoc.zip -d /usr/local \
|
||||||
rm /tmp/protoc.zip
|
&& rm /tmp/protoc.zip
|
||||||
/usr/local/bin/protoc --version
|
|
||||||
- name: Build Arm Manylinux Wheel
|
- name: Build Arm Manylinux Wheel
|
||||||
if: ${{ inputs.arm-build == 'true' }}
|
if: ${{ inputs.arm-build == 'true' }}
|
||||||
uses: PyO3/maturin-action@v1
|
uses: PyO3/maturin-action@v1
|
||||||
@@ -71,14 +50,13 @@ runs:
|
|||||||
maturin-version: "1.12.4"
|
maturin-version: "1.12.4"
|
||||||
command: build
|
command: build
|
||||||
working-directory: python
|
working-directory: python
|
||||||
docker-options: "-e PIP_EXTRA_INDEX_URL='https://pypi.fury.io/lance-format/ https://pypi.fury.io/lancedb/' -e PROTOC=/usr/local/bin/protoc ${{ inputs.rustflags != '' && format('-e RUSTFLAGS={0}', inputs.rustflags) || '' }}"
|
docker-options: "-e PIP_EXTRA_INDEX_URL='https://pypi.fury.io/lance-format/ https://pypi.fury.io/lancedb/'"
|
||||||
target: aarch64-unknown-linux-gnu
|
target: aarch64-unknown-linux-gnu
|
||||||
manylinux: ${{ inputs.manylinux }}
|
manylinux: ${{ inputs.manylinux }}
|
||||||
args: ${{ inputs.args }}
|
args: ${{ inputs.args }}
|
||||||
before-script-linux: |
|
before-script-linux: |
|
||||||
set -e
|
set -e
|
||||||
yum install -y clang
|
yum install -y clang \
|
||||||
curl -fsSL https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protoc-24.4-linux-aarch_64.zip -o /tmp/protoc.zip
|
&& curl -L https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protoc-24.4-linux-aarch_64.zip > /tmp/protoc.zip \
|
||||||
unzip /tmp/protoc.zip -d /usr/local
|
&& unzip /tmp/protoc.zip -d /usr/local \
|
||||||
rm /tmp/protoc.zip
|
&& rm /tmp/protoc.zip
|
||||||
/usr/local/bin/protoc --version
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ on:
|
|||||||
# We don't publish pre-releases for Rust. Crates.io is just a source
|
# We don't publish pre-releases for Rust. Crates.io is just a source
|
||||||
# distribution, so we don't need to publish pre-releases.
|
# distribution, so we don't need to publish pre-releases.
|
||||||
- "v*-beta*"
|
- "v*-beta*"
|
||||||
|
- "*-v*" # for example, python-vX.Y.Z
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# This env var is used by Swatinem/rust-cache@v2 for the cache
|
# This env var is used by Swatinem/rust-cache@v2 for the cache
|
||||||
@@ -24,7 +25,7 @@ jobs:
|
|||||||
# Only runs on tags that matches the make-release action
|
# Only runs on tags that matches the make-release action
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: rust
|
workspaces: rust
|
||||||
@@ -46,7 +47,7 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
issues: write
|
issues: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/create-failure-issue
|
- uses: ./.github/actions/create-failure-issue
|
||||||
with:
|
with:
|
||||||
job-results: ${{ toJSON(needs) }}
|
job-results: ${{ toJSON(needs) }}
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
name: CI scripts
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths:
|
|
||||||
- ci/set_lance_version.py
|
|
||||||
- ci/tests/**
|
|
||||||
- .github/workflows/ci-scripts.yml
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- ci/set_lance_version.py
|
|
||||||
- ci/tests/**
|
|
||||||
- .github/workflows/ci-scripts.yml
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
name: Test CI scripts
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: "3.13"
|
|
||||||
- name: Run tests
|
|
||||||
run: python -m unittest discover -s ci/tests -v
|
|
||||||
@@ -36,14 +36,14 @@ jobs:
|
|||||||
echo "guidelines = ${{ inputs.guidelines }}"
|
echo "guidelines = ${{ inputs.guidelines }}"
|
||||||
|
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
# pnpm 11 (used by the nodejs install step below) requires
|
# pnpm 11 (used by the nodejs install step below) requires
|
||||||
# Node >= 22.13; use 24 since 22 hits EOL in October.
|
# Node >= 22.13; use 24 since 22 hits EOL in October.
|
||||||
@@ -82,7 +82,7 @@ jobs:
|
|||||||
cache: maven
|
cache: maven
|
||||||
|
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v6
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: 11.1.1
|
version: 11.1.1
|
||||||
- name: Install Node.js dependencies for TypeScript bindings
|
- name: Install Node.js dependencies for TypeScript bindings
|
||||||
|
|||||||
@@ -4,16 +4,14 @@ on:
|
|||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tag:
|
||||||
description: "Tag name from Lance (e.g. `v7.2.0-beta.1`). If omitted, the newest release is resolved automatically — stable releases are preferred over pre-releases — and the run is skipped if it is not newer than the version currently pinned in Cargo.toml."
|
description: "Tag name from Lance"
|
||||||
required: false
|
required: true
|
||||||
default: ""
|
|
||||||
type: string
|
type: string
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tag:
|
||||||
description: "Tag name from Lance (e.g. `v7.2.0-beta.1`). Leave empty to resolve the newest release automatically — stable releases are preferred over pre-releases — and skip the run if it is not newer than the version currently pinned in Cargo.toml."
|
description: "Tag name from Lance"
|
||||||
required: false
|
required: true
|
||||||
default: ""
|
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
@@ -27,16 +25,16 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Show inputs
|
- name: Show inputs
|
||||||
run: |
|
run: |
|
||||||
echo "tag = ${{ inputs.tag || 'latest' }}"
|
echo "tag = ${{ inputs.tag }}"
|
||||||
|
|
||||||
- name: Checkout Repo LanceDB
|
- name: Checkout Repo LanceDB
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
@@ -73,21 +71,65 @@ jobs:
|
|||||||
OPENAI_API_KEY: ${{ secrets.CODEX_TOKEN }}
|
OPENAI_API_KEY: ${{ secrets.CODEX_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
TARGET_TAG="${TAG:-latest}"
|
VERSION="${TAG#refs/tags/}"
|
||||||
|
VERSION="${VERSION#v}"
|
||||||
|
BRANCH_NAME="codex/update-lance-${VERSION//[^a-zA-Z0-9]/-}"
|
||||||
|
|
||||||
|
# Use "chore" for beta/rc versions, "feat" for stable releases
|
||||||
|
if [[ "${VERSION}" == *beta* ]] || [[ "${VERSION}" == *rc* ]]; then
|
||||||
|
COMMIT_TYPE="chore"
|
||||||
|
else
|
||||||
|
COMMIT_TYPE="feat"
|
||||||
|
fi
|
||||||
|
|
||||||
cat <<EOF >/tmp/codex-prompt.txt
|
cat <<EOF >/tmp/codex-prompt.txt
|
||||||
You are running inside the lancedb repository on a GitHub Actions runner.
|
You are running inside the lancedb repository on a GitHub Actions runner. Update the Lance dependency to version ${VERSION} and prepare a pull request for maintainers to review.
|
||||||
|
|
||||||
Use \$lancedb-update-lance-dependency with target "${TARGET_TAG}".
|
Follow these steps exactly:
|
||||||
|
1. Use script "ci/set_lance_version.py" to update Lance Rust dependencies. The script already refreshes Cargo metadata, so allow it to finish even if it takes time.
|
||||||
|
2. Update the Java lance-core dependency version in "java/pom.xml": change the "<lance-core.version>...</lance-core.version>" property to "${VERSION}".
|
||||||
|
3. Run "cargo clippy --workspace --tests --all-features -- -D warnings". If diagnostics appear, fix them yourself and rerun clippy until it exits cleanly. Do not skip any warnings.
|
||||||
|
4. After clippy succeeds, run "cargo fmt --all" to format the workspace.
|
||||||
|
5. Ensure the repository is clean except for intentional changes. Inspect "git status --short" and "git diff" to confirm the dependency update and any required fixes.
|
||||||
|
6. Create and switch to a new branch named "${BRANCH_NAME}" (replace any duplicated hyphens if necessary).
|
||||||
|
7. Stage all relevant files with "git add -A". Commit using the message "${COMMIT_TYPE}: update lance dependency to v${VERSION}".
|
||||||
|
8. Push the branch to origin. If the remote branch already exists, delete it first with "gh api -X DELETE repos/lancedb/lancedb/git/refs/heads/${BRANCH_NAME}" then push with "git push origin ${BRANCH_NAME}". Do NOT use "git push --force" or "git push -f".
|
||||||
|
9. env "GH_TOKEN" is available, use "gh" tools for github related operations like creating pull request.
|
||||||
|
10. Create a pull request targeting "main" with title "${COMMIT_TYPE}: update lance dependency to v${VERSION}". First, write the PR body to /tmp/pr-body.md using a heredoc (cat <<'EOF' > /tmp/pr-body.md). The body should summarize the dependency bump, clippy/fmt verification, and link the triggering tag (${TAG}). Then run "gh pr create --body-file /tmp/pr-body.md".
|
||||||
|
11. After creating the PR, display the PR URL, "git status --short", and a concise summary of the commands run and their results.
|
||||||
|
|
||||||
Constraints:
|
Constraints:
|
||||||
- Use env "GH_TOKEN" for GitHub operations.
|
- Use bash commands; avoid modifying GitHub workflow files other than through the scripted task above.
|
||||||
- Do not merge the pull request.
|
- Do not merge the PR.
|
||||||
- Do not force-push.
|
- If any command fails, diagnose and fix the issue instead of aborting.
|
||||||
- Do not create a duplicate pull request if an open PR already exists for the target Lance version.
|
|
||||||
- If any command fails, diagnose and fix the root cause instead of aborting.
|
|
||||||
- After creating the PR, display the PR URL, "git status --short", and a concise summary of the commands run and their results.
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
printenv OPENAI_API_KEY | codex login --with-api-key
|
printenv OPENAI_API_KEY | codex login --with-api-key
|
||||||
codex --config shell_environment_policy.ignore_default_excludes=true exec --dangerously-bypass-approvals-and-sandbox "$(cat /tmp/codex-prompt.txt)"
|
codex --config shell_environment_policy.ignore_default_excludes=true exec --dangerously-bypass-approvals-and-sandbox "$(cat /tmp/codex-prompt.txt)"
|
||||||
|
|
||||||
|
- name: Trigger sophon dependency update
|
||||||
|
env:
|
||||||
|
TAG: ${{ inputs.tag }}
|
||||||
|
GH_TOKEN: ${{ secrets.ROBOT_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
VERSION="${TAG#refs/tags/}"
|
||||||
|
VERSION="${VERSION#v}"
|
||||||
|
LANCEDB_BRANCH="codex/update-lance-${VERSION//[^a-zA-Z0-9]/-}"
|
||||||
|
|
||||||
|
echo "Triggering sophon workflow with:"
|
||||||
|
echo " lance_ref: ${TAG#refs/tags/}"
|
||||||
|
echo " lancedb_ref: ${LANCEDB_BRANCH}"
|
||||||
|
|
||||||
|
gh workflow run codex-bump-lancedb-lance.yml \
|
||||||
|
--repo lancedb/sophon \
|
||||||
|
-f lance_ref="${TAG#refs/tags/}" \
|
||||||
|
-f lancedb_ref="${LANCEDB_BRANCH}"
|
||||||
|
|
||||||
|
- name: Show latest sophon workflow run
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.ROBOT_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
echo "Latest sophon workflow run:"
|
||||||
|
gh run list --repo lancedb/sophon --workflow codex-bump-lancedb-lance.yml --limit 1 --json databaseId,url,displayTitle
|
||||||
|
|||||||
@@ -27,16 +27,14 @@ jobs:
|
|||||||
name: Verify PR title / description conforms to semantic-release
|
name: Verify PR title / description conforms to semantic-release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "24"
|
node-version: "18"
|
||||||
- uses: pnpm/action-setup@v6
|
|
||||||
with:
|
|
||||||
version: 11.1.1
|
|
||||||
# These rules are disabled because Github will always ensure there
|
# These rules are disabled because Github will always ensure there
|
||||||
# is a blank line between the title and the body and Github will
|
# is a blank line between the title and the body and Github will
|
||||||
# word wrap the description field to ensure a reasonable max line
|
# word wrap the description field to ensure a reasonable max line
|
||||||
# length.
|
# length.
|
||||||
|
- run: npm install @commitlint/config-conventional
|
||||||
- run: >
|
- run: >
|
||||||
echo 'module.exports = {
|
echo 'module.exports = {
|
||||||
"rules": {
|
"rules": {
|
||||||
@@ -45,11 +43,7 @@ jobs:
|
|||||||
"body-leading-blank": [0, "always"]
|
"body-leading-blank": [0, "always"]
|
||||||
}
|
}
|
||||||
}' > .commitlintrc.js
|
}' > .commitlintrc.js
|
||||||
- run: >
|
- run: npx commitlint --extends @commitlint/config-conventional --verbose <<< $COMMIT_MSG
|
||||||
pnpm dlx
|
|
||||||
--package @commitlint/cli@21.2.2
|
|
||||||
--package @commitlint/config-conventional@21.2.2
|
|
||||||
commitlint --extends @commitlint/config-conventional --verbose <<< $COMMIT_MSG
|
|
||||||
env:
|
env:
|
||||||
COMMIT_MSG: >
|
COMMIT_MSG: >
|
||||||
${{ github.event.pull_request.title }}
|
${{ github.event.pull_request.title }}
|
||||||
@@ -60,7 +54,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const message = `**ACTION NEEDED**
|
const message = `**ACTION NEEDED**
|
||||||
|
|
||||||
Lance follows the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) for release automation.
|
Lance follows the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) for release automation.
|
||||||
|
|
||||||
The PR title and description are used as the merge commit message.\
|
The PR title and description are used as the merge commit message.\
|
||||||
|
|||||||
@@ -1,243 +0,0 @@
|
|||||||
name: Check doc links
|
|
||||||
|
|
||||||
# Checking external links is inherently noisy: third-party sites rate-limit
|
|
||||||
# automated clients, reject non-browser user agents, and go down temporarily.
|
|
||||||
# Blocking pull requests on that trades a lot of false failures for very little
|
|
||||||
# signal, so this runs on a schedule and reports findings in a single tracking
|
|
||||||
# issue instead of failing anyone's build.
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 7 * * *"
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
# The report lives in one repository-global issue, so runs must not overlap: a
|
|
||||||
# lookup racing a create produces duplicate issues, and a healthy run closing
|
|
||||||
# the issue while a failing run only rewrites its body would leave a broken
|
|
||||||
# report closed. The group is deliberately ref-independent so that a manual
|
|
||||||
# dispatch serializes against the scheduled run.
|
|
||||||
concurrency:
|
|
||||||
group: docs-link-check
|
|
||||||
cancel-in-progress: false
|
|
||||||
|
|
||||||
permissions: {}
|
|
||||||
|
|
||||||
env:
|
|
||||||
REPORT_TITLE: "Docs link checker report"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
scan:
|
|
||||||
name: Scan links
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
# lychee-action is pinned by SHA, but its wrapper downloads the lychee
|
|
||||||
# release tarball at run time without verifying a digest, and hands the
|
|
||||||
# resulting binary a GitHub token. Release assets remain replaceable, so
|
|
||||||
# that binary is confined to a job whose token can only read public
|
|
||||||
# content; everything that writes runs in the report job below.
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
outputs:
|
|
||||||
checker_outcome: ${{ steps.lychee.outcome }}
|
|
||||||
exit_code: ${{ steps.lychee.outputs.exit_code }}
|
|
||||||
status: ${{ steps.validate.outputs.status }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
# workflow_dispatch can run from any ref, but the report is
|
|
||||||
# repository-global. Always measure the default branch so a manual
|
|
||||||
# run from a topic branch cannot close a report that main warrants,
|
|
||||||
# or overwrite it with branch-only findings.
|
|
||||||
ref: ${{ github.event.repository.default_branch }}
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Check links
|
|
||||||
id: lychee
|
|
||||||
continue-on-error: true
|
|
||||||
uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0
|
|
||||||
with:
|
|
||||||
# Restricted to http(s) on purpose. Much of docs/src is generated
|
|
||||||
# API reference (the js/ tree comes from `pnpm run docs` in nodejs)
|
|
||||||
# and the hand-written pages use mkdocstrings cross-references and
|
|
||||||
# nav-relative paths that only resolve in the site mkdocs builds,
|
|
||||||
# not in this checkout, so relative links would be reported as
|
|
||||||
# broken on every run.
|
|
||||||
args: >-
|
|
||||||
--scheme https
|
|
||||||
--scheme http
|
|
||||||
--no-progress
|
|
||||||
--max-retries 3
|
|
||||||
--timeout 20
|
|
||||||
'docs/src/**/*.md'
|
|
||||||
format: json
|
|
||||||
output: ./lychee/out.json
|
|
||||||
jobSummary: false
|
|
||||||
# The report issue, not a red workflow run, is the signal for link
|
|
||||||
# findings and checker failures alike.
|
|
||||||
fail: false
|
|
||||||
|
|
||||||
- name: Validate report
|
|
||||||
id: validate
|
|
||||||
# lychee does not reserve exit code 2 for broken links: its CLI
|
|
||||||
# parser also exits 2 on an invalid option, before any link was
|
|
||||||
# checked or any report written. Only a parseable report whose
|
|
||||||
# counts agree with a completed exit code (0 or 2) counts as a link
|
|
||||||
# verdict. Everything else becomes a checker-error report instead of
|
|
||||||
# failing the workflow. Exit 2 covers timeouts as well as errors, and a
|
|
||||||
# timed-out host is exactly the transient unavailability this report
|
|
||||||
# exists to surface, so both count as findings. Requiring total > 0
|
|
||||||
# also catches a glob that silently stopped matching any file.
|
|
||||||
if: always()
|
|
||||||
env:
|
|
||||||
CHECKER_OUTCOME: ${{ steps.lychee.outcome }}
|
|
||||||
EXIT_CODE: ${{ steps.lychee.outputs.exit_code }}
|
|
||||||
run: |
|
|
||||||
status=checker-error
|
|
||||||
if [[ "$CHECKER_OUTCOME" == success ]] &&
|
|
||||||
[[ "$EXIT_CODE" == 0 || "$EXIT_CODE" == 2 ]] &&
|
|
||||||
jq -e --argjson code "$EXIT_CODE" '
|
|
||||||
(.total > 0) and
|
|
||||||
(if $code == 0
|
|
||||||
then .errors == 0 and .timeouts == 0
|
|
||||||
and (.error_map | length == 0) and (.timeout_map | length == 0)
|
|
||||||
else (.errors + .timeouts) > 0
|
|
||||||
and ((.error_map | length) + (.timeout_map | length)) > 0
|
|
||||||
end)
|
|
||||||
' ./lychee/out.json
|
|
||||||
then
|
|
||||||
if [[ "$EXIT_CODE" == 0 ]]; then
|
|
||||||
status=healthy
|
|
||||||
else
|
|
||||||
status=findings
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
echo "status=$status" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "Validated link check as $status"
|
|
||||||
|
|
||||||
- name: Upload report
|
|
||||||
if: steps.validate.outputs.status == 'findings'
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: link-report
|
|
||||||
path: ./lychee/out.json
|
|
||||||
retention-days: 7
|
|
||||||
|
|
||||||
report:
|
|
||||||
name: Update report issue
|
|
||||||
needs: scan
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
# Deliberately no checkout: this job needs the report artifact and the
|
|
||||||
# issues API, not the repository contents.
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
env:
|
|
||||||
CHECKER_OUTCOME: ${{ needs.scan.outputs.checker_outcome }}
|
|
||||||
EXIT_CODE: ${{ needs.scan.outputs.exit_code }}
|
|
||||||
STATUS: ${{ needs.scan.outputs.status }}
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
steps:
|
|
||||||
- name: Find existing report issue
|
|
||||||
id: report
|
|
||||||
# Matched on title alone, and through search rather than a listing:
|
|
||||||
# the issue action applies labels in a separate call after creating the
|
|
||||||
# issue, so a label filter misses a half-created report, and this
|
|
||||||
# repository has far more open issues than one listing page holds.
|
|
||||||
# Closed issues are included because a healthy run closes the report:
|
|
||||||
# an open-only lookup would forget that identity and the next failing
|
|
||||||
# run would open a duplicate. The oldest match stays the canonical
|
|
||||||
# report and is reopened below when a problem recurs.
|
|
||||||
run: |
|
|
||||||
match=$(gh issue list --repo "$GITHUB_REPOSITORY" --state all \
|
|
||||||
--search "in:title \"$REPORT_TITLE\" author:app/github-actions" \
|
|
||||||
--limit 50 --json number,title,state \
|
|
||||||
--jq "[.[] | select(.title == \"$REPORT_TITLE\")] | sort_by(.number) | first // empty")
|
|
||||||
echo "number=$(jq -r '.number // empty' <<<"$match")" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "state=$(jq -r '.state // empty' <<<"$match")" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Download report
|
|
||||||
if: env.STATUS == 'findings'
|
|
||||||
uses: actions/download-artifact@v8
|
|
||||||
with:
|
|
||||||
name: link-report
|
|
||||||
path: ./lychee
|
|
||||||
|
|
||||||
- name: Compose report
|
|
||||||
if: env.STATUS == 'findings'
|
|
||||||
run: |
|
|
||||||
run_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
|
|
||||||
{
|
|
||||||
echo "Broken documentation links found by [\`$GITHUB_WORKFLOW\`]($run_url)."
|
|
||||||
echo
|
|
||||||
echo "This issue is rewritten by every scheduled run and closed automatically once all links resolve."
|
|
||||||
echo
|
|
||||||
echo "Entries can be false positives: some sites rate-limit or block automated clients while working fine in a browser. Confirm before editing the docs, and add persistent offenders to \`--exclude\` in \`.github/workflows/docs-link-check.yml\`."
|
|
||||||
echo
|
|
||||||
# Timeouts are reported alongside errors: entries land in
|
|
||||||
# timeout_map with a status text instead of an HTTP code.
|
|
||||||
jq -r '
|
|
||||||
"\(.errors) of \(.total) links failed, \(.timeouts) timed out.",
|
|
||||||
"",
|
|
||||||
([(.error_map | to_entries[]), (.timeout_map | to_entries[])]
|
|
||||||
| group_by(.key)[] |
|
|
||||||
"### Errors in \(.[0].key)",
|
|
||||||
"",
|
|
||||||
(map(.value[])[] | "* [\(.status.code // .status.text // "ERR")] <\(.url)> — \(.status.details // .status.text // "unknown error")"),
|
|
||||||
"")
|
|
||||||
' ./lychee/out.json
|
|
||||||
} > ./lychee/issue.md
|
|
||||||
|
|
||||||
- name: Compose checker error report
|
|
||||||
if: env.STATUS == 'checker-error'
|
|
||||||
run: |
|
|
||||||
mkdir -p ./lychee
|
|
||||||
run_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
|
|
||||||
{
|
|
||||||
echo "The documentation link check did not complete in [the latest run]($run_url)."
|
|
||||||
echo
|
|
||||||
echo "This issue is rewritten by every scheduled run and closed automatically once a trustworthy run finds that all links resolve."
|
|
||||||
echo
|
|
||||||
echo "The checker did not produce a trustworthy link verdict. Treat the previous result, if any, as stale until a later run completes."
|
|
||||||
echo
|
|
||||||
echo "* Action outcome: \`$CHECKER_OUTCOME\`"
|
|
||||||
echo "* Exit code: \`${EXIT_CODE:-not reported}\`"
|
|
||||||
echo "* Verdict validation: \`failed\`"
|
|
||||||
} > ./lychee/issue.md
|
|
||||||
|
|
||||||
- name: Reopen report issue
|
|
||||||
# A healthy run closes the report, and the issue action below only
|
|
||||||
# rewrites the body of whatever number it is given. Without an
|
|
||||||
# explicit reopen, a later finding or checker error would rewrite a
|
|
||||||
# closed issue. A CLOSED state implies the lookup found a canonical
|
|
||||||
# issue, so no separate emptiness check.
|
|
||||||
if: >-
|
|
||||||
env.STATUS != 'healthy' &&
|
|
||||||
steps.report.outputs.state == 'CLOSED'
|
|
||||||
env:
|
|
||||||
ISSUE_NUMBER: ${{ steps.report.outputs.number }}
|
|
||||||
run: |
|
|
||||||
run_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
|
|
||||||
gh issue reopen "$ISSUE_NUMBER" --repo "$GITHUB_REPOSITORY" \
|
|
||||||
--comment "The documentation link checker reported a problem again in [the latest run]($run_url)."
|
|
||||||
|
|
||||||
- name: Report link-check problem
|
|
||||||
if: env.STATUS != 'healthy'
|
|
||||||
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6.0.0
|
|
||||||
with:
|
|
||||||
# Empty on the first failing run, which creates the issue; afterwards
|
|
||||||
# the same issue is updated in place.
|
|
||||||
issue-number: ${{ steps.report.outputs.number }}
|
|
||||||
title: ${{ env.REPORT_TITLE }}
|
|
||||||
content-filepath: ./lychee/issue.md
|
|
||||||
labels: documentation
|
|
||||||
|
|
||||||
- name: Close report issue once links are healthy
|
|
||||||
# An OPEN state implies the lookup found a canonical issue; a report
|
|
||||||
# that is already closed needs nothing.
|
|
||||||
if: >-
|
|
||||||
env.STATUS == 'healthy' &&
|
|
||||||
steps.report.outputs.state == 'OPEN'
|
|
||||||
env:
|
|
||||||
ISSUE_NUMBER: ${{ steps.report.outputs.number }}
|
|
||||||
run: |
|
|
||||||
run_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
|
|
||||||
gh issue close "$ISSUE_NUMBER" --repo "$GITHUB_REPOSITORY" \
|
|
||||||
--comment "All documentation links resolved in [the latest run]($run_url)."
|
|
||||||
@@ -35,7 +35,7 @@ jobs:
|
|||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
- name: Install dependencies needed for ubuntu
|
- name: Install dependencies needed for ubuntu
|
||||||
run: |
|
run: |
|
||||||
sudo apt install -y protobuf-compiler libssl-dev
|
sudo apt install -y protobuf-compiler libssl-dev
|
||||||
@@ -53,9 +53,11 @@ jobs:
|
|||||||
python -m pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -e .
|
python -m pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -e .
|
||||||
python -m pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -r ../docs/requirements.txt
|
python -m pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -r ../docs/requirements.txt
|
||||||
- name: Set up node
|
- name: Set up node
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 24
|
node-version: 20
|
||||||
|
cache: 'npm'
|
||||||
|
cache-dependency-path: docs/package-lock.json
|
||||||
- name: Install node dependencies
|
- name: Install node dependencies
|
||||||
working-directory: nodejs
|
working-directory: nodejs
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -1,85 +0,0 @@
|
|||||||
name: GitHub Release
|
|
||||||
|
|
||||||
# All SDKs share one version, so a single `vX.Y.Z` tag produces a single GitHub
|
|
||||||
# release covering all of them. The per-package publish workflows (PyPI, NPM,
|
|
||||||
# Cargo, Maven) trigger off the same tag independently.
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v*"
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
gh-release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
lfs: true
|
|
||||||
- name: Extract version
|
|
||||||
id: extract_version
|
|
||||||
env:
|
|
||||||
GITHUB_REF: ${{ github.ref }}
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
echo "Extracting tag and version from $GITHUB_REF"
|
|
||||||
if [[ $GITHUB_REF =~ refs/tags/v(.*) ]]; then
|
|
||||||
VERSION=${BASH_REMATCH[1]}
|
|
||||||
TAG=v$VERSION
|
|
||||||
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "Failed to extract version from $GITHUB_REF"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Extracted version $VERSION from $GITHUB_REF"
|
|
||||||
if [[ $VERSION =~ beta ]]; then
|
|
||||||
echo "This is a beta release"
|
|
||||||
echo "prerelease=true" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# Get last release (that is not this one)
|
|
||||||
FROM_TAG=$(git tag --sort='version:refname' \
|
|
||||||
| grep ^v \
|
|
||||||
| grep -vF "$TAG" \
|
|
||||||
| python ci/semver_sort.py v \
|
|
||||||
| tail -n 1)
|
|
||||||
else
|
|
||||||
echo "This is a stable release"
|
|
||||||
echo "prerelease=false" >> $GITHUB_OUTPUT
|
|
||||||
# Get last stable tag (ignore betas)
|
|
||||||
FROM_TAG=$(git tag --sort='version:refname' \
|
|
||||||
| grep ^v \
|
|
||||||
| grep -vF "$TAG" \
|
|
||||||
| grep -v beta \
|
|
||||||
| python ci/semver_sort.py v \
|
|
||||||
| tail -n 1)
|
|
||||||
fi
|
|
||||||
echo "Found from tag $FROM_TAG"
|
|
||||||
echo "from_tag=$FROM_TAG" >> $GITHUB_OUTPUT
|
|
||||||
- name: Create Release Notes
|
|
||||||
id: release_notes
|
|
||||||
uses: mikepenz/release-changelog-builder-action@v4
|
|
||||||
with:
|
|
||||||
configuration: .github/release_notes.json
|
|
||||||
toTag: ${{ steps.extract_version.outputs.tag }}
|
|
||||||
fromTag: ${{ steps.extract_version.outputs.from_tag }}
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Create GH release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
# Marking betas as pre-releases keeps them from taking the "Latest"
|
|
||||||
# badge on the releases page.
|
|
||||||
prerelease: ${{ steps.extract_version.outputs.prerelease }}
|
|
||||||
make_latest: ${{ steps.extract_version.outputs.prerelease == 'false' }}
|
|
||||||
tag_name: ${{ steps.extract_version.outputs.tag }}
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
generate_release_notes: false
|
|
||||||
name: LanceDB v${{ steps.extract_version.outputs.version }}
|
|
||||||
body: ${{ steps.release_notes.outputs.changelog }}
|
|
||||||
@@ -32,7 +32,7 @@ jobs:
|
|||||||
working-directory: ./java
|
working-directory: ./java
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
- name: Set up Java 8
|
- name: Set up Java 8
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
@@ -73,7 +73,7 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
issues: write
|
issues: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/create-failure-issue
|
- uses: ./.github/actions/create-failure-issue
|
||||||
with:
|
with:
|
||||||
job-results: ${{ toJSON(needs) }}
|
job-results: ${{ toJSON(needs) }}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ jobs:
|
|||||||
working-directory: ./java
|
working-directory: ./java
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
- name: Set up Java 17
|
- name: Set up Java 17
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
name: Lance Release Timer
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "*/10 * * * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
actions: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: lance-release-timer
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
trigger-update:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Check for new Lance tag
|
||||||
|
id: check
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.ROBOT_TOKEN }}
|
||||||
|
run: |
|
||||||
|
python3 ci/check_lance_release.py --github-output "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Look for existing PR
|
||||||
|
if: steps.check.outputs.needs_update == 'true'
|
||||||
|
id: pr
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.ROBOT_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
TITLE="chore: update lance dependency to v${{ steps.check.outputs.latest_version }}"
|
||||||
|
COUNT=$(gh pr list --search "\"$TITLE\" in:title" --state open --limit 1 --json number --jq 'length')
|
||||||
|
if [ "$COUNT" -gt 0 ]; then
|
||||||
|
echo "Open PR already exists for $TITLE"
|
||||||
|
echo "pr_exists=true" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "No existing PR for $TITLE"
|
||||||
|
echo "pr_exists=false" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Trigger codex update workflow
|
||||||
|
if: steps.check.outputs.needs_update == 'true' && steps.pr.outputs.pr_exists != 'true'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.ROBOT_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
TAG=${{ steps.check.outputs.latest_tag }}
|
||||||
|
gh workflow run codex-update-lance-dependency.yml -f tag=refs/tags/$TAG
|
||||||
|
|
||||||
|
- name: Show latest codex workflow run
|
||||||
|
if: steps.check.outputs.needs_update == 'true' && steps.pr.outputs.pr_exists != 'true'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.ROBOT_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
gh run list --workflow codex-update-lance-dependency.yml --limit 1 --json databaseId,url,displayTitle
|
||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
- name: Install license-header-checker
|
- name: Install license-header-checker
|
||||||
working-directory: /tmp
|
working-directory: /tmp
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
name: Create release commit
|
name: Create release commit
|
||||||
|
|
||||||
# This workflow increments the version, tags it, and pushes it. All SDKs share
|
# This workflow increments versions, tags the version, and pushes it.
|
||||||
# a single version, so one tag releases all of them.
|
|
||||||
# When a tag is pushed, another workflow is triggered that creates a GH release
|
# When a tag is pushed, another workflow is triggered that creates a GH release
|
||||||
# and uploads the binaries. This workflow is only for creating the tag.
|
# and uploads the binaries. This workflow is only for creating the tag.
|
||||||
|
|
||||||
# This script will enforce that a minor version is incremented if there are any
|
# This script will enforce that a minor version is incremented if there are any
|
||||||
# breaking changes since the last minor increment. A breaking change in any SDK
|
# breaking changes since the last minor increment. However, it isn't able to
|
||||||
# bumps the minor version for all of them. If you wish to bypass this check, you
|
# differentiate between breaking changes in Node versus Python. If you wish to
|
||||||
# can manually increment the version and push the tag.
|
# bypass this check, you can manually increment the version and push the tag.
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
@@ -25,6 +24,16 @@ on:
|
|||||||
options:
|
options:
|
||||||
- preview
|
- preview
|
||||||
- stable
|
- stable
|
||||||
|
python:
|
||||||
|
description: 'Make a Python release'
|
||||||
|
required: true
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
|
other:
|
||||||
|
description: 'Make a Node/Rust/Java release'
|
||||||
|
required: true
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
bump-minor:
|
bump-minor:
|
||||||
description: 'Bump minor version'
|
description: 'Bump minor version'
|
||||||
required: true
|
required: true
|
||||||
@@ -40,7 +49,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Output Inputs
|
- name: Output Inputs
|
||||||
run: echo "${{ toJSON(github.event.inputs) }}"
|
run: echo "${{ toJSON(github.event.inputs) }}"
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -56,16 +65,29 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config user.name 'Lance Release'
|
git config user.name 'Lance Release'
|
||||||
git config user.email 'lance-dev@lancedb.com'
|
git config user.email 'lance-dev@lancedb.com'
|
||||||
- name: Bump version
|
- name: Bump Python version
|
||||||
|
if: ${{ inputs.python }}
|
||||||
|
working-directory: python
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
# Need to get the commit before bumping the version, so we can
|
||||||
|
# determine if there are breaking changes in the next step as well.
|
||||||
|
echo "COMMIT_BEFORE_BUMP=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
pip install bump-my-version PyGithub packaging
|
||||||
|
bash ../ci/bump_version.sh ${{ inputs.type }} ${{ inputs.bump-minor }} python-v
|
||||||
|
- name: Bump Node/Rust version
|
||||||
|
if: ${{ inputs.other }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
pip install bump-my-version PyGithub packaging
|
pip install bump-my-version PyGithub packaging
|
||||||
bash ci/bump_version.sh ${{ inputs.type }} ${{ inputs.bump-minor }}
|
bash ci/bump_version.sh ${{ inputs.type }} ${{ inputs.bump-minor }} v $COMMIT_BEFORE_BUMP
|
||||||
bash ci/update_lockfiles.sh --amend
|
bash ci/update_lockfiles.sh --amend
|
||||||
- name: Push new version tag
|
- name: Push new version tag
|
||||||
if: ${{ !inputs.dry_run }}
|
if: ${{ !inputs.dry_run }}
|
||||||
uses: ad-m/github-push-action@881a6320fdb16eb5318c5054f31c218aec2b324c # v1.3.0
|
uses: ad-m/github-push-action@master
|
||||||
with:
|
with:
|
||||||
# Need to use PAT here too to trigger next workflow. See comment above.
|
# Need to use PAT here too to trigger next workflow. See comment above.
|
||||||
github_token: ${{ secrets.LANCEDB_RELEASE_TOKEN }}
|
github_token: ${{ secrets.LANCEDB_RELEASE_TOKEN }}
|
||||||
|
|||||||
@@ -38,17 +38,18 @@ jobs:
|
|||||||
CC: gcc-12
|
CC: gcc-12
|
||||||
CXX: g++-12
|
CXX: g++-12
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
- uses: pnpm/action-setup@v6
|
- uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: 11.1.1
|
version: 11.1.1
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
# Build on a supported LTS; the matrix job below covers every
|
# pnpm 11 requires Node >= 22.13; use 24 since 22 hits EOL
|
||||||
# Node version the library claims to support.
|
# in October. The library itself still supports Node >= 18
|
||||||
|
# (see test matrix below).
|
||||||
node-version: 24
|
node-version: 24
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: nodejs/pnpm-lock.yaml
|
cache-dependency-path: nodejs/pnpm-lock.yaml
|
||||||
@@ -60,11 +61,6 @@ jobs:
|
|||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y protobuf-compiler libssl-dev
|
sudo apt install -y protobuf-compiler libssl-dev
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Format Rust
|
- name: Format Rust
|
||||||
run: cargo fmt --all -- --check
|
run: cargo fmt --all -- --check
|
||||||
- name: Lint Rust
|
- name: Lint Rust
|
||||||
@@ -83,35 +79,30 @@ jobs:
|
|||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [ "22", "24", "26" ]
|
node-version: [ "18", "20" ]
|
||||||
runs-on: "ubuntu-22.04"
|
runs-on: "ubuntu-22.04"
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: nodejs
|
working-directory: nodejs
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
- uses: pnpm/action-setup@v6
|
- uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: 11.1.1
|
version: 11.1.1
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v4
|
||||||
name: Setup Node.js 24 for build
|
name: Setup Node.js 24 for build
|
||||||
with:
|
with:
|
||||||
# Build and install once on a fixed version so the generated docs
|
# pnpm 11 requires Node >= 22.13; use 24 since 22 hits EOL
|
||||||
# are identical across matrix legs; the tests below then run on each
|
# in October. Build/install runs on Node 24; tests run on the
|
||||||
# supported Node version.
|
# matrix version below using direct jest invocation.
|
||||||
node-version: 24
|
node-version: 24
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: nodejs/pnpm-lock.yaml
|
cache-dependency-path: nodejs/pnpm-lock.yaml
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
@@ -139,7 +130,7 @@ jobs:
|
|||||||
echo "Run 'pnpm run docs', fix any warnings, and commit the changes."
|
echo "Run 'pnpm run docs', fix any warnings, and commit the changes."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v4
|
||||||
name: Setup Node.js ${{ matrix.node-version }} for test
|
name: Setup Node.js ${{ matrix.node-version }} for test
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
@@ -151,9 +142,9 @@ jobs:
|
|||||||
S3_TEST: "1"
|
S3_TEST: "1"
|
||||||
# Newer @smithy/core uses dynamic ESM imports.
|
# Newer @smithy/core uses dynamic ESM imports.
|
||||||
NODE_OPTIONS: "--experimental-vm-modules"
|
NODE_OPTIONS: "--experimental-vm-modules"
|
||||||
# Invoke the installed jest binary directly; the pnpm shim is set up
|
# Invoke jest directly because pnpm 11 itself requires Node 22+
|
||||||
# against the build-phase Node, not the version selected above.
|
# while the matrix tests on older Node versions.
|
||||||
run: node_modules/.bin/jest --verbose
|
run: npx jest --verbose
|
||||||
- name: Test examples
|
- name: Test examples
|
||||||
working-directory: ./
|
working-directory: ./
|
||||||
env:
|
env:
|
||||||
@@ -163,7 +154,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python ci/mock_openai.py &
|
python ci/mock_openai.py &
|
||||||
cd nodejs/examples
|
cd nodejs/examples
|
||||||
node_modules/.bin/jest --testEnvironment jest-environment-node-single-context --verbose
|
npx jest --testEnvironment jest-environment-node-single-context --verbose
|
||||||
macos:
|
macos:
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
# macos-15 ships a newer linker; the older macos-14 linker fails to insert
|
# macos-15 ships a newer linker; the older macos-14 linker fails to insert
|
||||||
@@ -175,26 +166,22 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: nodejs
|
working-directory: nodejs
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
- uses: pnpm/action-setup@v6
|
- uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: 11.1.1
|
version: 11.1.1
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
# pnpm 11 requires Node >= 22.13.
|
# pnpm 11 requires Node >= 22.13; use 24 since 22 hits EOL
|
||||||
|
# in October.
|
||||||
node-version: 24
|
node-version: 24
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: nodejs/pnpm-lock.yaml
|
cache-dependency-path: nodejs/pnpm-lock.yaml
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
brew install protobuf
|
brew install protobuf
|
||||||
|
|||||||
+109
-169
@@ -10,16 +10,10 @@ permissions:
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
# The cross-compiled targets (musl especially) break from toolchain and
|
|
||||||
# dependency changes that nothing else in CI catches, and discovering that
|
|
||||||
# mid-release is expensive. A nightly run keeps that signal while dropping
|
|
||||||
# the full 8-target release matrix from all ~90 pushes to main each month.
|
|
||||||
# `report-failure` files an issue when a nightly breaks.
|
|
||||||
schedule:
|
|
||||||
- cron: "0 8 * * *"
|
|
||||||
workflow_dispatch:
|
|
||||||
pull_request:
|
pull_request:
|
||||||
# This should trigger a dry run (we skip the final publish step)
|
# This should trigger a dry run (we skip the final publish step)
|
||||||
paths:
|
paths:
|
||||||
@@ -32,6 +26,73 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
gh-release:
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
lfs: true
|
||||||
|
- name: Extract version
|
||||||
|
id: extract_version
|
||||||
|
env:
|
||||||
|
GITHUB_REF: ${{ github.ref }}
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
echo "Extracting tag and version from $GITHUB_REF"
|
||||||
|
if [[ $GITHUB_REF =~ refs/tags/v(.*) ]]; then
|
||||||
|
VERSION=${BASH_REMATCH[1]}
|
||||||
|
TAG=v$VERSION
|
||||||
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "Failed to extract version from $GITHUB_REF"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Extracted version $VERSION from $GITHUB_REF"
|
||||||
|
if [[ $VERSION =~ beta ]]; then
|
||||||
|
echo "This is a beta release"
|
||||||
|
|
||||||
|
# Get last release (that is not this one)
|
||||||
|
FROM_TAG=$(git tag --sort='version:refname' \
|
||||||
|
| grep ^v \
|
||||||
|
| grep -vF "$TAG" \
|
||||||
|
| python ci/semver_sort.py v \
|
||||||
|
| tail -n 1)
|
||||||
|
else
|
||||||
|
echo "This is a stable release"
|
||||||
|
# Get last stable tag (ignore betas)
|
||||||
|
FROM_TAG=$(git tag --sort='version:refname' \
|
||||||
|
| grep ^v \
|
||||||
|
| grep -vF "$TAG" \
|
||||||
|
| grep -v beta \
|
||||||
|
| python ci/semver_sort.py v \
|
||||||
|
| tail -n 1)
|
||||||
|
fi
|
||||||
|
echo "Found from tag $FROM_TAG"
|
||||||
|
echo "from_tag=$FROM_TAG" >> $GITHUB_OUTPUT
|
||||||
|
- name: Create Release Notes
|
||||||
|
id: release_notes
|
||||||
|
uses: mikepenz/release-changelog-builder-action@v4
|
||||||
|
with:
|
||||||
|
configuration: .github/release_notes.json
|
||||||
|
toTag: ${{ steps.extract_version.outputs.tag }}
|
||||||
|
fromTag: ${{ steps.extract_version.outputs.from_tag }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Create GH release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
prerelease: ${{ contains('beta', github.ref) }}
|
||||||
|
tag_name: ${{ steps.extract_version.outputs.tag }}
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
generate_release_notes: false
|
||||||
|
name: Node/Rust LanceDB v${{ steps.extract_version.outputs.version }}
|
||||||
|
body: ${{ steps.release_notes.outputs.changelog }}
|
||||||
|
|
||||||
build-lancedb:
|
build-lancedb:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -40,17 +101,10 @@ jobs:
|
|||||||
- target: aarch64-apple-darwin
|
- target: aarch64-apple-darwin
|
||||||
host: macos-latest
|
host: macos-latest
|
||||||
features: fp16kernels
|
features: fp16kernels
|
||||||
# Fat LTO was ~111 of this job's ~113 minutes.
|
pre_build: brew install protobuf
|
||||||
lto: thin
|
|
||||||
codegen_units: 16
|
|
||||||
pre_build: |-
|
|
||||||
brew install protobuf
|
|
||||||
- target: x86_64-pc-windows-msvc
|
- target: x86_64-pc-windows-msvc
|
||||||
host: windows-2025
|
host: windows-latest
|
||||||
features: ","
|
features: ","
|
||||||
# The lower peak also keeps this on the standard 4-core runner.
|
|
||||||
lto: thin
|
|
||||||
codegen_units: 16
|
|
||||||
pre_build: |-
|
pre_build: |-
|
||||||
choco install --no-progress protoc ninja nasm
|
choco install --no-progress protoc ninja nasm
|
||||||
tail -n 1000 /c/ProgramData/chocolatey/logs/chocolatey.log
|
tail -n 1000 /c/ProgramData/chocolatey/logs/chocolatey.log
|
||||||
@@ -58,10 +112,8 @@ jobs:
|
|||||||
export PATH="$PATH:/c/Program Files/NASM"
|
export PATH="$PATH:/c/Program Files/NASM"
|
||||||
nasm -v
|
nasm -v
|
||||||
- target: aarch64-pc-windows-msvc
|
- target: aarch64-pc-windows-msvc
|
||||||
host: windows-2025
|
host: windows-latest
|
||||||
features: ","
|
features: ","
|
||||||
lto: thin
|
|
||||||
codegen_units: 16
|
|
||||||
pre_build: |-
|
pre_build: |-
|
||||||
choco install --no-progress protoc
|
choco install --no-progress protoc
|
||||||
rustup target add aarch64-pc-windows-msvc
|
rustup target add aarch64-pc-windows-msvc
|
||||||
@@ -94,14 +146,6 @@ jobs:
|
|||||||
# https://github.com/napi-rs/napi-rs/blob/main/debian-aarch64.Dockerfile
|
# https://github.com/napi-rs/napi-rs/blob/main/debian-aarch64.Dockerfile
|
||||||
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
|
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
|
||||||
features: "fp16kernels"
|
features: "fp16kernels"
|
||||||
# Fat LTO OOM-killed rustc every nightly; even with lld it peaked
|
|
||||||
# at 31391 MiB of the runner's 32 GiB.
|
|
||||||
lto: thin
|
|
||||||
codegen_units: 16
|
|
||||||
# arm64 Linux links through GNU `ld` where x86_64 defaults to
|
|
||||||
# `rust-lld`, which is why only arm64 OOM'd. lld cut the largest
|
|
||||||
# linker process 7.0 -> 4.0 GiB (lancedb/sophon#7313).
|
|
||||||
linker: /tmp/aarch64-lld-clang
|
|
||||||
pre_build: |-
|
pre_build: |-
|
||||||
set -e &&
|
set -e &&
|
||||||
apt-get update &&
|
apt-get update &&
|
||||||
@@ -111,30 +155,9 @@ jobs:
|
|||||||
# AT_HWCAP2 (added in Linux 3.17). Define it for aws-lc-sys.
|
# AT_HWCAP2 (added in Linux 3.17). Define it for aws-lc-sys.
|
||||||
export CFLAGS="$CFLAGS -DAT_HWCAP2=26" &&
|
export CFLAGS="$CFLAGS -DAT_HWCAP2=26" &&
|
||||||
rustup target add aarch64-unknown-linux-gnu
|
rustup target add aarch64-unknown-linux-gnu
|
||||||
# Not `&&`-chained: in dash, errexit does not fire for a
|
|
||||||
# non-final command in an `&&` list, so failures were ignored.
|
|
||||||
#
|
|
||||||
# A wrapper rather than `-C link-arg` because the per-target
|
|
||||||
# rustflags variable does not reach every unit that links, while
|
|
||||||
# the linker variable does. `clang` because GCC silently ignores
|
|
||||||
# `-fuse-ld=lld` unless built with lld support. Two echoes
|
|
||||||
# because printf's newline escape gets rewritten to `;` between
|
|
||||||
# here and the container.
|
|
||||||
echo '#!/bin/sh' > /tmp/aarch64-lld-clang
|
|
||||||
echo 'exec clang --target=aarch64-unknown-linux-gnu --sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot --gcc-toolchain=/usr/aarch64-unknown-linux-gnu -fuse-ld=lld "$@"' >> /tmp/aarch64-lld-clang
|
|
||||||
chmod 0755 /tmp/aarch64-lld-clang
|
|
||||||
# Fail now, not at the cdylib link ~30 minutes later. Linking at
|
|
||||||
# all also proves lld resolved; clang errors out when it cannot.
|
|
||||||
echo 'int main(void){return 0;}' > /tmp/probe.c
|
|
||||||
/tmp/aarch64-lld-clang /tmp/probe.c -o /tmp/probe
|
|
||||||
readelf -h /tmp/probe | grep AArch64
|
|
||||||
- target: aarch64-unknown-linux-musl
|
- target: aarch64-unknown-linux-musl
|
||||||
host: ubuntu-2404-8x-x64
|
host: ubuntu-2404-8x-x64
|
||||||
features: ","
|
features: ","
|
||||||
# Fat LTO took the whole runner down. lld cannot help: it died
|
|
||||||
# inside rustc's LLVM, before any linker was spawned.
|
|
||||||
lto: thin
|
|
||||||
codegen_units: 16
|
|
||||||
pre_build: |-
|
pre_build: |-
|
||||||
set -e &&
|
set -e &&
|
||||||
sudo apt-get update &&
|
sudo apt-get update &&
|
||||||
@@ -143,32 +166,20 @@ jobs:
|
|||||||
export EXTRA_ARGS="-x"
|
export EXTRA_ARGS="-x"
|
||||||
name: build - ${{ matrix.settings.target }}
|
name: build - ${{ matrix.settings.target }}
|
||||||
runs-on: ${{ matrix.settings.host }}
|
runs-on: ${{ matrix.settings.host }}
|
||||||
# On the job, not exported from `pre_build`: `Swatinem/rust-cache` hashes
|
|
||||||
# `CARGO_*` into its cache key before any step runs, so a step-local export
|
|
||||||
# leaves the key unchanged while cargo still rebuilds cold. The ThinLTO
|
|
||||||
# legs had been doing that every run.
|
|
||||||
#
|
|
||||||
# Not `RUSTFLAGS`: setting it, even to "", discards every config-file
|
|
||||||
# rustflag, silently dropping .cargo/config.toml's `target-cpu` and
|
|
||||||
# `target-feature` from the published binaries.
|
|
||||||
env:
|
|
||||||
CARGO_PROFILE_RELEASE_LTO: ${{ matrix.settings.lto || 'fat' }}
|
|
||||||
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: ${{ matrix.settings.codegen_units || '1' }}
|
|
||||||
# Empty elsewhere: a per-target variable is only read for that triple.
|
|
||||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: ${{ matrix.settings.linker }}
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: nodejs
|
working-directory: nodejs
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v6
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: 11.1.1
|
version: 11.1.1
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
# pnpm 11 requires Node >= 22.13.
|
# pnpm 11 requires Node >= 22.13; use 24 since 22 hits EOL
|
||||||
|
# in October.
|
||||||
node-version: 24
|
node-version: 24
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
cache-dependency-path: nodejs/pnpm-lock.yaml
|
cache-dependency-path: nodejs/pnpm-lock.yaml
|
||||||
@@ -178,45 +189,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
targets: ${{ matrix.settings.target }}
|
targets: ${{ matrix.settings.target }}
|
||||||
# These builds were entirely uncached: the old key was static, so
|
- name: Cache cargo
|
||||||
# `actions/cache` (which only writes on a miss) could never refresh it,
|
uses: actions/cache@v4
|
||||||
# and the multi-GB whole-`target/` copy it tried to store never fit the
|
|
||||||
# repo's cache budget, so no entry was ever saved. rust-cache prunes
|
|
||||||
# `target/` to dependency artifacts and keys on Cargo.lock plus the rustc
|
|
||||||
# version, which both fixes the key and keeps entries a sane size.
|
|
||||||
#
|
|
||||||
# This caches dependency *compilation* only. The LTO link of the cdylib
|
|
||||||
# re-runs regardless, since the local crate changes every time, so the
|
|
||||||
# win is larger on the non-LTO jobs than here.
|
|
||||||
- name: Cache cargo (native builds)
|
|
||||||
uses: Swatinem/rust-cache@v2
|
|
||||||
if: ${{ !matrix.settings.docker }}
|
|
||||||
with:
|
with:
|
||||||
# The release profile and per-target dirs differ from what the test
|
path: |
|
||||||
# workflows cache, so these need to be separate entries.
|
~/.cargo/registry/index/
|
||||||
key: release-${{ matrix.settings.target }}
|
~/.cargo/registry/cache/
|
||||||
# Only the nightly run on main writes, so tag and PR runs restore a
|
~/.cargo/git/db/
|
||||||
# warm entry without every dependabot PR writing its own (which would
|
.cargo-cache
|
||||||
# be unreadable elsewhere anyway, since GitHub scopes caches to the
|
target/
|
||||||
# creating ref). The nightly cadence also keeps entries inside
|
key: nodejs-${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
|
||||||
# GitHub's 7-day eviction window, which a tag-only trigger would not.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
# Docker builds can use rust-cache too: the workspace is bind-mounted, so
|
|
||||||
# `target/` lives on the host and rust-cache's prune keeps the entry
|
|
||||||
# small.
|
|
||||||
#
|
|
||||||
# Two differences from the native builds. The container's CARGO_HOME is
|
|
||||||
# bind-mounted from `.cargo-cache` rather than ~/.cargo, so that is cached
|
|
||||||
# explicitly. And the key uses the *host* rustc version, not the compiler
|
|
||||||
# that built these artifacts -- safe, since cargo fingerprints the real
|
|
||||||
# one; a base-image bump just costs one cold build.
|
|
||||||
- name: Cache cargo (docker builds)
|
|
||||||
uses: Swatinem/rust-cache@v2
|
|
||||||
if: ${{ matrix.settings.docker }}
|
|
||||||
with:
|
|
||||||
key: docker-${{ matrix.settings.target }}
|
|
||||||
cache-directories: .cargo-cache
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
- name: Install Zig
|
- name: Install Zig
|
||||||
@@ -234,43 +216,24 @@ jobs:
|
|||||||
if: ${{ matrix.settings.docker }}
|
if: ${{ matrix.settings.docker }}
|
||||||
with:
|
with:
|
||||||
image: ${{ matrix.settings.docker }}
|
image: ${{ matrix.settings.docker }}
|
||||||
# All three mounts must live under `.cargo-cache`, which is what the
|
|
||||||
# cache step above saves. Previously the registry mounts pointed at
|
|
||||||
# `.cargo/...`, a path nothing cached, so the container re-downloaded
|
|
||||||
# the whole crate registry on every run.
|
|
||||||
#
|
|
||||||
# `docker run` inherits nothing; `-e NAME` carries the job's `env:` in.
|
|
||||||
options: "--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db \
|
options: "--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db \
|
||||||
-v ${{ github.workspace }}/.cargo-cache/registry/cache:/usr/local/cargo/registry/cache \
|
-v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache \
|
||||||
-v ${{ github.workspace }}/.cargo-cache/registry/index:/usr/local/cargo/registry/index \
|
-v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index \
|
||||||
-e CARGO_PROFILE_RELEASE_LTO \
|
|
||||||
-e CARGO_PROFILE_RELEASE_CODEGEN_UNITS \
|
|
||||||
-e CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER \
|
|
||||||
-v ${{ github.workspace }}:/build -w /build/nodejs"
|
-v ${{ github.workspace }}:/build -w /build/nodejs"
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
${{ matrix.settings.pre_build }}
|
${{ matrix.settings.pre_build }}
|
||||||
node_modules/.bin/napi build --platform --release \
|
npx napi build --platform --release \
|
||||||
--features ${{ matrix.settings.features }} \
|
--features ${{ matrix.settings.features }} \
|
||||||
--target ${{ matrix.settings.target }} \
|
--target ${{ matrix.settings.target }} \
|
||||||
--dts ../lancedb/native.d.ts \
|
--dts ../lancedb/native.d.ts \
|
||||||
--js ../lancedb/native.js \
|
--js ../lancedb/native.js \
|
||||||
--strip \
|
--strip \
|
||||||
--output-dir dist/
|
--output-dir dist/
|
||||||
# The container runs as root (`--user 0:0`), so everything it wrote to the
|
|
||||||
# mounted cache dirs is root-owned. rust-cache's post step runs as the
|
|
||||||
# runner user and has to both read these and delete from them while
|
|
||||||
# pruning, so hand them back before it runs.
|
|
||||||
- name: Take ownership of docker build output
|
|
||||||
if: ${{ matrix.settings.docker }}
|
|
||||||
run: |
|
|
||||||
sudo chown -R "$(id -u):$(id -g)" \
|
|
||||||
"${{ github.workspace }}/.cargo-cache" \
|
|
||||||
"${{ github.workspace }}/target"
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
${{ matrix.settings.pre_build }}
|
${{ matrix.settings.pre_build }}
|
||||||
node_modules/.bin/napi build --platform --release \
|
npx napi build --platform --release \
|
||||||
--features ${{ matrix.settings.features }} \
|
--features ${{ matrix.settings.features }} \
|
||||||
--target ${{ matrix.settings.target }} \
|
--target ${{ matrix.settings.target }} \
|
||||||
--dts ../lancedb/native.d.ts \
|
--dts ../lancedb/native.d.ts \
|
||||||
@@ -280,29 +243,8 @@ jobs:
|
|||||||
--output-dir dist/
|
--output-dir dist/
|
||||||
if: ${{ !matrix.settings.docker }}
|
if: ${{ !matrix.settings.docker }}
|
||||||
shell: bash
|
shell: bash
|
||||||
# The standard Windows runners have ~14 GB free, and a release `target/`
|
|
||||||
# for this workspace is a large fraction of that. Report the remaining
|
|
||||||
# headroom so a build that only just fits is visible before a dependency
|
|
||||||
# bump turns it into a failed release. `always()` so the numbers are
|
|
||||||
# still there when the build is what ran out of space.
|
|
||||||
- name: Report disk headroom
|
|
||||||
if: always()
|
|
||||||
run: df -h
|
|
||||||
shell: bash
|
|
||||||
- name: Report peak memory
|
|
||||||
if: always() && runner.os == 'Linux'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
peak=$(find /sys/fs/cgroup -name memory.peak -readable \
|
|
||||||
-exec cat {} + 2>/dev/null | sort -n | tail -1)
|
|
||||||
if [ -n "$peak" ]; then
|
|
||||||
echo "peak memory: $((peak / 1024 / 1024)) MiB"
|
|
||||||
else
|
|
||||||
echo "peak memory: unavailable (no readable cgroup v2 memory.peak)"
|
|
||||||
fi
|
|
||||||
free -g || true
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: lancedb-${{ matrix.settings.target }}
|
name: lancedb-${{ matrix.settings.target }}
|
||||||
path: nodejs/dist/*.node
|
path: nodejs/dist/*.node
|
||||||
@@ -314,7 +256,7 @@ jobs:
|
|||||||
run: pnpm tsc
|
run: pnpm tsc
|
||||||
- name: Upload Generic Artifacts
|
- name: Upload Generic Artifacts
|
||||||
if: ${{ matrix.settings.target == 'aarch64-apple-darwin' }}
|
if: ${{ matrix.settings.target == 'aarch64-apple-darwin' }}
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: nodejs-dist
|
name: nodejs-dist
|
||||||
path: |
|
path: |
|
||||||
@@ -338,20 +280,20 @@ jobs:
|
|||||||
- target: aarch64-unknown-linux-gnu
|
- target: aarch64-unknown-linux-gnu
|
||||||
host: ubuntu-2404-8x-arm64
|
host: ubuntu-2404-8x-arm64
|
||||||
node:
|
node:
|
||||||
- '22'
|
- '20'
|
||||||
runs-on: ${{ matrix.settings.host }}
|
runs-on: ${{ matrix.settings.host }}
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: nodejs
|
working-directory: nodejs
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v6
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: 11.1.1
|
version: 11.1.1
|
||||||
- name: Setup Node.js 24 for install
|
- name: Setup Node.js 24 for install
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
# pnpm 11 requires Node >= 22.13; use 24 since 22 hits EOL
|
# pnpm 11 requires Node >= 22.13; use 24 since 22 hits EOL
|
||||||
# in October.
|
# in October.
|
||||||
@@ -361,18 +303,18 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
- name: Setup Node.js ${{ matrix.node }} for test
|
- name: Setup Node.js ${{ matrix.node }} for test
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v8
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: lancedb-${{ matrix.settings.target }}
|
name: lancedb-${{ matrix.settings.target }}
|
||||||
path: nodejs/dist/
|
path: nodejs/dist/
|
||||||
# For testing purposes:
|
# For testing purposes:
|
||||||
# run-id: 13982782871
|
# run-id: 13982782871
|
||||||
# github-token: ${{ secrets.GITHUB_TOKEN }} # token with actions:read permissions on target repo
|
# github-token: ${{ secrets.GITHUB_TOKEN }} # token with actions:read permissions on target repo
|
||||||
- uses: actions/download-artifact@v8
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: nodejs-dist
|
name: nodejs-dist
|
||||||
path: nodejs/dist
|
path: nodejs/dist
|
||||||
@@ -384,9 +326,9 @@ jobs:
|
|||||||
- name: Move built files
|
- name: Move built files
|
||||||
run: cp dist/native.d.ts dist/native.js dist/*.node lancedb/
|
run: cp dist/native.d.ts dist/native.js dist/*.node lancedb/
|
||||||
- name: Test bindings
|
- name: Test bindings
|
||||||
# Invoke the installed jest binary directly; the pnpm shim is set up
|
# Invoke jest directly because pnpm 11 itself requires Node 22+
|
||||||
# against the install-phase Node, not the version selected above.
|
# while the matrix tests on older Node versions.
|
||||||
run: node_modules/.bin/jest --verbose
|
run: npx jest --verbose
|
||||||
publish:
|
publish:
|
||||||
name: Publish
|
name: Publish
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -397,13 +339,13 @@ jobs:
|
|||||||
needs:
|
needs:
|
||||||
- test-lancedb
|
- test-lancedb
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v6
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: 11.1.1
|
version: 11.1.1
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 24
|
node-version: 24
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
@@ -411,14 +353,14 @@ jobs:
|
|||||||
registry-url: "https://registry.npmjs.org"
|
registry-url: "https://registry.npmjs.org"
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
- uses: actions/download-artifact@v8
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: nodejs-dist
|
name: nodejs-dist
|
||||||
path: nodejs/dist
|
path: nodejs/dist
|
||||||
# For testing purposes:
|
# For testing purposes:
|
||||||
# run-id: 13982782871
|
# run-id: 13982782871
|
||||||
# github-token: ${{ secrets.GITHUB_TOKEN }} # token with actions:read permissions on target repo
|
# github-token: ${{ secrets.GITHUB_TOKEN }} # token with actions:read permissions on target repo
|
||||||
- uses: actions/download-artifact@v8
|
- uses: actions/download-artifact@v4
|
||||||
name: Download arch-specific binaries
|
name: Download arch-specific binaries
|
||||||
with:
|
with:
|
||||||
pattern: lancedb-*
|
pattern: lancedb-*
|
||||||
@@ -451,14 +393,12 @@ jobs:
|
|||||||
name: Report Workflow Failure
|
name: Report Workflow Failure
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build-lancedb, test-lancedb, publish]
|
needs: [build-lancedb, test-lancedb, publish]
|
||||||
# Nightly runs are the only thing watching the cross-compiled targets now,
|
if: always() && failure() && startsWith(github.ref, 'refs/tags/v')
|
||||||
# so they have to report failures too or the signal is silently lost.
|
|
||||||
if: always() && failure() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'schedule')
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
issues: write
|
issues: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/create-failure-issue
|
- uses: ./.github/actions/create-failure-issue
|
||||||
with:
|
with:
|
||||||
job-results: ${{ toJSON(needs) }}
|
job-results: ${{ toJSON(needs) }}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ name: PyPI Publish
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'python-v*'
|
||||||
pull_request:
|
pull_request:
|
||||||
# This should trigger a dry run (we skip the final publish step)
|
# This should trigger a dry run (we skip the final publish step)
|
||||||
paths:
|
paths:
|
||||||
@@ -20,15 +20,9 @@ env:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
# Without this, a force-push to a PR leaves the previous run going -- including
|
|
||||||
# a ~74 minute Windows job and a billed arm64 wheel build.
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
linux:
|
linux:
|
||||||
name: Python ${{ matrix.config.package_name }} ${{ matrix.config.platform }} manylinux${{ matrix.config.manylinux }}
|
name: Python ${{ matrix.config.platform }} manylinux${{ matrix.config.manylinux }}
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -37,28 +31,11 @@ jobs:
|
|||||||
manylinux: "2_28"
|
manylinux: "2_28"
|
||||||
extra_args: "--features fp16kernels"
|
extra_args: "--features fp16kernels"
|
||||||
runner: ubuntu-22.04
|
runner: ubuntu-22.04
|
||||||
package_name: "lancedb"
|
|
||||||
rustflags: ""
|
|
||||||
# For successful fat LTO builds, we need a large runner to avoid OOM errors.
|
# For successful fat LTO builds, we need a large runner to avoid OOM errors.
|
||||||
- platform: aarch64
|
- platform: aarch64
|
||||||
manylinux: "2_28"
|
manylinux: "2_28"
|
||||||
extra_args: "--features fp16kernels"
|
extra_args: "--features fp16kernels"
|
||||||
runner: ubuntu-2404-8x-arm64
|
runner: ubuntu-2404-8x-arm64
|
||||||
package_name: "lancedb"
|
|
||||||
rustflags: ""
|
|
||||||
# `lancedb-compat`: pre-Haswell-friendly variant for x86_64 hosts
|
|
||||||
# without AVX2 (Sandy Bridge / Ivy Bridge / Westmere on Intel,
|
|
||||||
# Bulldozer / Piledriver / Steamroller on AMD). Compiled at the
|
|
||||||
# `x86-64-v2` baseline; runtime SIMD dispatch in lance-linalg
|
|
||||||
# picks the appropriate tier (scalar / AVX / AVX+FMA / AVX2+FMA
|
|
||||||
# / AVX-512) at load time. Same import as `lancedb` -- conflicts
|
|
||||||
# at install time, so users pick one.
|
|
||||||
- platform: x86_64
|
|
||||||
manylinux: "2_28"
|
|
||||||
extra_args: ""
|
|
||||||
runner: ubuntu-22.04
|
|
||||||
package_name: "lancedb-compat"
|
|
||||||
rustflags: "-Ctarget-cpu=x86-64-v2"
|
|
||||||
runs-on: ${{ matrix.config.runner }}
|
runs-on: ${{ matrix.config.runner }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
@@ -69,29 +46,17 @@ jobs:
|
|||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: "3.10"
|
||||||
- name: Add swap for Arm fat LTO
|
|
||||||
if: matrix.config.platform == 'aarch64'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
swap_file="$RUNNER_TEMP/lancedb-swap"
|
|
||||||
sudo fallocate --length 16G "$swap_file"
|
|
||||||
sudo chmod 600 "$swap_file"
|
|
||||||
sudo mkswap "$swap_file"
|
|
||||||
sudo swapon "$swap_file"
|
|
||||||
free -h
|
|
||||||
- uses: ./.github/workflows/build_linux_wheel
|
- uses: ./.github/workflows/build_linux_wheel
|
||||||
with:
|
with:
|
||||||
python-minor-version: 10
|
python-minor-version: 10
|
||||||
args: "--release --strip ${{ matrix.config.extra_args }}"
|
args: "--release --strip ${{ matrix.config.extra_args }}"
|
||||||
arm-build: ${{ matrix.config.platform == 'aarch64' }}
|
arm-build: ${{ matrix.config.platform == 'aarch64' }}
|
||||||
manylinux: ${{ matrix.config.manylinux }}
|
manylinux: ${{ matrix.config.manylinux }}
|
||||||
package-name: ${{ matrix.config.package_name }}
|
|
||||||
rustflags: ${{ matrix.config.rustflags }}
|
|
||||||
- uses: actions/upload-artifact@v7
|
- uses: actions/upload-artifact@v7
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/python-v')
|
||||||
with:
|
with:
|
||||||
name: wheels-linux-${{ matrix.config.package_name }}-${{ matrix.config.platform }}-${{ matrix.config.manylinux }}
|
name: wheels-linux-${{ matrix.config.platform }}-${{ matrix.config.manylinux }}
|
||||||
path: target/wheels/*.whl
|
path: target/wheels/lancedb-*.whl
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
mac:
|
mac:
|
||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
@@ -117,7 +82,7 @@ jobs:
|
|||||||
python-minor-version: 10
|
python-minor-version: 10
|
||||||
args: "--release --strip --target ${{ matrix.config.target }} --features fp16kernels"
|
args: "--release --strip --target ${{ matrix.config.target }} --features fp16kernels"
|
||||||
- uses: actions/upload-artifact@v7
|
- uses: actions/upload-artifact@v7
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/python-v')
|
||||||
with:
|
with:
|
||||||
name: wheels-mac-${{ matrix.config.target }}
|
name: wheels-mac-${{ matrix.config.target }}
|
||||||
path: target/wheels/lancedb-*.whl
|
path: target/wheels/lancedb-*.whl
|
||||||
@@ -129,12 +94,6 @@ jobs:
|
|||||||
# link.exe is single-threaded and the long pole on Windows builds. Use
|
# link.exe is single-threaded and the long pole on Windows builds. Use
|
||||||
# rustc's bundled lld-link instead.
|
# rustc's bundled lld-link instead.
|
||||||
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER: rust-lld
|
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER: rust-lld
|
||||||
# Fat LTO of the cdylib is single-threaded and the peak-memory step of the
|
|
||||||
# build. ThinLTO parallelizes it across the runner's cores, at some cost
|
|
||||||
# to runtime performance on our least performance-sensitive platform.
|
|
||||||
# Matches what the nodejs Windows builds already do in npm-publish.yml.
|
|
||||||
CARGO_PROFILE_RELEASE_LTO: thin
|
|
||||||
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 16
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
@@ -144,26 +103,19 @@ jobs:
|
|||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.13"
|
python-version: "3.13"
|
||||||
# NOTE: caching cargo here would be a no-op. This workflow only runs on
|
|
||||||
# tags and PRs, and GitHub only lets a run restore caches from its own ref
|
|
||||||
# or the default branch -- so with no run on main there is nothing that
|
|
||||||
# can populate an entry the release build would be allowed to read. Fixing
|
|
||||||
# this needs a main/nightly trigger (which would also catch wheel-build
|
|
||||||
# breakage before a release); the ~74 minutes here is otherwise dominated
|
|
||||||
# by the fat-LTO link, which no cache avoids.
|
|
||||||
- uses: ./.github/workflows/build_windows_wheel
|
- uses: ./.github/workflows/build_windows_wheel
|
||||||
with:
|
with:
|
||||||
python-minor-version: 10
|
python-minor-version: 10
|
||||||
args: "--release --strip"
|
args: "--release --strip"
|
||||||
- uses: actions/upload-artifact@v7
|
- uses: actions/upload-artifact@v7
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/python-v')
|
||||||
with:
|
with:
|
||||||
name: wheels-windows
|
name: wheels-windows
|
||||||
path: target/wheels/lancedb-*.whl
|
path: target/wheels/lancedb-*.whl
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
publish:
|
publish:
|
||||||
name: Publish wheels
|
name: Publish wheels
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/python-v')
|
||||||
needs: [linux, mac, windows]
|
needs: [linux, mac, windows]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
@@ -193,7 +145,7 @@ jobs:
|
|||||||
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
|
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
WHEELS=(target/wheels/*.whl)
|
WHEELS=(target/wheels/lancedb-*.whl)
|
||||||
if [[ ${#WHEELS[@]} -eq 0 ]]; then
|
if [[ ${#WHEELS[@]} -eq 0 ]]; then
|
||||||
echo "No wheels found in target/wheels/" >&2
|
echo "No wheels found in target/wheels/" >&2
|
||||||
exit 1
|
exit 1
|
||||||
@@ -212,6 +164,72 @@ jobs:
|
|||||||
uses: pypa/gh-action-pypi-publish@release/v1
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
with:
|
with:
|
||||||
packages-dir: target/wheels/
|
packages-dir: target/wheels/
|
||||||
|
gh-release:
|
||||||
|
if: startsWith(github.ref, 'refs/tags/python-v')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
lfs: true
|
||||||
|
- name: Extract version
|
||||||
|
id: extract_version
|
||||||
|
env:
|
||||||
|
GITHUB_REF: ${{ github.ref }}
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
echo "Extracting tag and version from $GITHUB_REF"
|
||||||
|
if [[ $GITHUB_REF =~ refs/tags/python-v(.*) ]]; then
|
||||||
|
VERSION=${BASH_REMATCH[1]}
|
||||||
|
TAG=python-v$VERSION
|
||||||
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "Failed to extract version from $GITHUB_REF"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Extracted version $VERSION from $GITHUB_REF"
|
||||||
|
if [[ $VERSION =~ beta ]]; then
|
||||||
|
echo "This is a beta release"
|
||||||
|
|
||||||
|
# Get last release (that is not this one)
|
||||||
|
FROM_TAG=$(git tag --sort='version:refname' \
|
||||||
|
| grep ^python-v \
|
||||||
|
| grep -vF "$TAG" \
|
||||||
|
| python ci/semver_sort.py python-v \
|
||||||
|
| tail -n 1)
|
||||||
|
else
|
||||||
|
echo "This is a stable release"
|
||||||
|
# Get last stable tag (ignore betas)
|
||||||
|
FROM_TAG=$(git tag --sort='version:refname' \
|
||||||
|
| grep ^python-v \
|
||||||
|
| grep -vF "$TAG" \
|
||||||
|
| grep -v beta \
|
||||||
|
| python ci/semver_sort.py python-v \
|
||||||
|
| tail -n 1)
|
||||||
|
fi
|
||||||
|
echo "Found from tag $FROM_TAG"
|
||||||
|
echo "from_tag=$FROM_TAG" >> $GITHUB_OUTPUT
|
||||||
|
- name: Create Python Release Notes
|
||||||
|
id: python_release_notes
|
||||||
|
uses: mikepenz/release-changelog-builder-action@v4
|
||||||
|
with:
|
||||||
|
configuration: .github/release_notes.json
|
||||||
|
toTag: ${{ steps.extract_version.outputs.tag }}
|
||||||
|
fromTag: ${{ steps.extract_version.outputs.from_tag }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Create Python GH release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
prerelease: ${{ contains('beta', github.ref) }}
|
||||||
|
tag_name: ${{ steps.extract_version.outputs.tag }}
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
generate_release_notes: false
|
||||||
|
name: Python LanceDB v${{ steps.extract_version.outputs.version }}
|
||||||
|
body: ${{ steps.python_release_notes.outputs.changelog }}
|
||||||
report-failure:
|
report-failure:
|
||||||
name: Report Workflow Failure
|
name: Report Workflow Failure
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -219,7 +237,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
issues: write
|
issues: write
|
||||||
if: always() && failure() && startsWith(github.ref, 'refs/tags/v')
|
if: always() && failure() && startsWith(github.ref, 'refs/tags/python-v')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- uses: ./.github/actions/create-failure-issue
|
- uses: ./.github/actions/create-failure-issue
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: python
|
working-directory: python
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -66,7 +66,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: python
|
working-directory: python
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -95,7 +95,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: python
|
working-directory: python
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -108,15 +108,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y protobuf-compiler
|
sudo apt install -y protobuf-compiler
|
||||||
# `pip install -e .` builds the extension with maturin, which is most of
|
|
||||||
# this job's ~33 minutes. It had no Rust cache, so every dependency was
|
|
||||||
# recompiled from scratch on every run.
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install
|
- name: Install
|
||||||
run: |
|
run: |
|
||||||
pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -e .[tests,dev,embeddings]
|
pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -e .[tests,dev,embeddings]
|
||||||
@@ -135,7 +126,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: python
|
working-directory: python
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -169,7 +160,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: python
|
working-directory: python
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -177,14 +168,6 @@ jobs:
|
|||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.13"
|
python-version: "3.13"
|
||||||
# maturin runs cargo natively on macOS (docker is Linux-only), so the host
|
|
||||||
# target dir is cacheable. This job had no Rust cache.
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- uses: ./.github/workflows/build_mac_wheel
|
- uses: ./.github/workflows/build_mac_wheel
|
||||||
with:
|
with:
|
||||||
args: --profile ci
|
args: --profile ci
|
||||||
@@ -206,7 +189,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: python
|
working-directory: python
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -214,14 +197,6 @@ jobs:
|
|||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.13"
|
python-version: "3.13"
|
||||||
# maturin runs cargo natively on Windows (docker is Linux-only), so the
|
|
||||||
# host target dir is cacheable. This job had no Rust cache at all and so
|
|
||||||
# rebuilt every dependency from scratch on every run.
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. The repo sits at
|
|
||||||
# GitHub's cache cap, so per-PR saves just evict main's entries.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- uses: ./.github/workflows/build_windows_wheel
|
- uses: ./.github/workflows/build_windows_wheel
|
||||||
with:
|
with:
|
||||||
args: --profile ci
|
args: --profile ci
|
||||||
@@ -229,8 +204,7 @@ jobs:
|
|||||||
# Make sure wheels are not included in the Rust cache
|
# Make sure wheels are not included in the Rust cache
|
||||||
- name: Delete wheels
|
- name: Delete wheels
|
||||||
run: rm -rf target/wheels
|
run: rm -rf target/wheels
|
||||||
min-deps:
|
pydantic1x:
|
||||||
name: "Minimum dependencies"
|
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
runs-on: "ubuntu-24.04"
|
runs-on: "ubuntu-24.04"
|
||||||
defaults:
|
defaults:
|
||||||
@@ -238,7 +212,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: python
|
working-directory: python
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -250,17 +224,10 @@ jobs:
|
|||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: "3.10"
|
||||||
# As with Doctest, `pip install -e .` compiles the extension and this job
|
|
||||||
# had no Rust cache, which is most of its ~37 minutes.
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install lancedb
|
- name: Install lancedb
|
||||||
run: |
|
run: |
|
||||||
pip install "pydantic==2.7.4" "pyarrow==16"
|
pip install "pydantic<2"
|
||||||
|
pip install pyarrow==16
|
||||||
pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -e .[tests]
|
pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -e .[tests]
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: pytest -m "not slow and not s3_test" -x -v --durations=30 python/tests
|
run: pytest -m "not slow and not s3_test" -x -v --durations=30 python/tests
|
||||||
|
|||||||
+31
-115
@@ -40,7 +40,7 @@ jobs:
|
|||||||
CC: clang-18
|
CC: clang-18
|
||||||
CXX: clang++-18
|
CXX: clang++-18
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -48,11 +48,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
components: rustfmt, clippy
|
components: rustfmt, clippy
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
@@ -70,7 +65,7 @@ jobs:
|
|||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- uses: EmbarkStudios/cargo-deny-action@v2
|
- uses: EmbarkStudios/cargo-deny-action@v2
|
||||||
with:
|
with:
|
||||||
command: check advisories bans licenses sources
|
command: check advisories bans licenses sources
|
||||||
@@ -83,7 +78,7 @@ jobs:
|
|||||||
CC: clang
|
CC: clang
|
||||||
CXX: clang++
|
CXX: clang++
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
# Building without a lock file often requires the latest Rust version since downstream
|
# Building without a lock file often requires the latest Rust version since downstream
|
||||||
# dependencies may have updated their minimum Rust version.
|
# dependencies may have updated their minimum Rust version.
|
||||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
@@ -94,11 +89,6 @@ jobs:
|
|||||||
run: rm -f Cargo.lock
|
run: rm -f Cargo.lock
|
||||||
- uses: rui314/setup-mold@v1
|
- uses: rui314/setup-mold@v1
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
@@ -108,7 +98,7 @@ jobs:
|
|||||||
cargo build --profile ci --benches --all-features --tests
|
cargo build --profile ci --benches --all-features --tests
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
timeout-minutes: 60
|
timeout-minutes: 30
|
||||||
# To build all features, we need more disk space than is available
|
# To build all features, we need more disk space than is available
|
||||||
# on the free OSS github runner. This is mostly due to the the
|
# on the free OSS github runner. This is mostly due to the the
|
||||||
# sentence-transformers feature.
|
# sentence-transformers feature.
|
||||||
@@ -121,17 +111,13 @@ jobs:
|
|||||||
# Need up-to-date compilers for kernels
|
# Need up-to-date compilers for kernels
|
||||||
CC: clang-18
|
CC: clang-18
|
||||||
CXX: clang++-18
|
CXX: clang++-18
|
||||||
|
GH_TOKEN: ${{ secrets.SOPHON_READ_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
@@ -139,69 +125,24 @@ jobs:
|
|||||||
- uses: rui314/setup-mold@v1
|
- uses: rui314/setup-mold@v1
|
||||||
- name: Make Swap
|
- name: Make Swap
|
||||||
run: |
|
run: |
|
||||||
swapfile=/swapfile
|
sudo fallocate -l 16G /swapfile
|
||||||
min_swap_bytes=$((15 * 1024 * 1024 * 1024))
|
sudo chmod 600 /swapfile
|
||||||
active_swap_bytes="$(sudo swapon --show=NAME,SIZE --bytes --noheadings | awk '$1 == "/swapfile" { print $2 }')"
|
sudo mkswap /swapfile
|
||||||
if [ -n "$active_swap_bytes" ]; then
|
sudo swapon /swapfile
|
||||||
if [ "$active_swap_bytes" -ge "$min_swap_bytes" ]; then
|
|
||||||
echo "/swapfile is already active with enough space; skipping swap creation"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
echo "/swapfile is already active but smaller than 16G; using /mnt/lancedb-swapfile"
|
|
||||||
swapfile=/mnt/lancedb-swapfile
|
|
||||||
fi
|
|
||||||
if sudo swapon --show=NAME --noheadings | grep -Fxq "$swapfile"; then
|
|
||||||
echo "$swapfile is already active; skipping swap creation"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
sudo rm -f "$swapfile"
|
|
||||||
sudo fallocate -l 16G "$swapfile"
|
|
||||||
sudo chmod 600 "$swapfile"
|
|
||||||
sudo mkswap "$swapfile"
|
|
||||||
sudo swapon "$swapfile"
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --profile ci --all-features --tests --locked --examples
|
run: cargo build --profile ci --all-features --tests --locked --examples
|
||||||
- name: Run feature tests
|
- name: Run feature tests
|
||||||
run: CARGO_ARGS="--profile ci" make -C ./lancedb feature-tests
|
run: CARGO_ARGS="--profile ci" make -C ./lancedb feature-tests
|
||||||
- name: Run examples
|
- name: Run examples
|
||||||
run: cargo run --profile ci --all-features --example simple --locked
|
run: cargo run --profile ci --example simple --locked
|
||||||
|
|
||||||
remote:
|
|
||||||
timeout-minutes: 30
|
|
||||||
# Running this requires access to secrets, so skip if this is a PR from a
|
|
||||||
# fork. Keep it separate from the all-features build so Cargo does not
|
|
||||||
# retain both dependency graphs in one target directory.
|
|
||||||
if: github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork
|
|
||||||
runs-on: ubuntu-2404-4x-x64
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
working-directory: rust
|
|
||||||
env:
|
|
||||||
CC: clang-18
|
|
||||||
CXX: clang++-18
|
|
||||||
GH_TOKEN: ${{ secrets.SOPHON_READ_TOKEN }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
lfs: true
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
# Remote tests use a different feature graph from the main Linux
|
|
||||||
# job. Cache downloads, but build into a fresh target directory.
|
|
||||||
cache-targets: false
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -y protobuf-compiler libssl-dev
|
|
||||||
- uses: rui314/setup-mold@v1
|
|
||||||
- name: Run remote tests
|
- name: Run remote tests
|
||||||
|
# Running this requires access to secrets, so skip if this is
|
||||||
|
# a PR from a fork.
|
||||||
|
if: github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork
|
||||||
run: CARGO_ARGS="--profile ci" make -C ./lancedb remote-tests
|
run: CARGO_ARGS="--profile ci" make -C ./lancedb remote-tests
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
timeout-minutes: 60
|
timeout-minutes: 30
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
mac-runner: ["macos-14", "macos-15"]
|
mac-runner: ["macos-14", "macos-15"]
|
||||||
@@ -211,18 +152,13 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: rust
|
working-directory: rust
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
- name: CPU features
|
- name: CPU features
|
||||||
run: sysctl -a | grep cpu
|
run: sysctl -a | grep cpu
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: brew install protobuf
|
run: brew install protobuf
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
@@ -235,32 +171,20 @@ jobs:
|
|||||||
cargo test --profile ci --features $ALL_FEATURES --locked
|
cargo test --profile ci --features $ALL_FEATURES --locked
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
|
runs-on: windows-2022
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
target:
|
||||||
- target: x86_64-pc-windows-msvc
|
- x86_64-pc-windows-msvc
|
||||||
runner: windows-2022
|
- aarch64-pc-windows-msvc
|
||||||
# windows-11-arm is a standard runner, so it is free on public repos.
|
|
||||||
# Running natively lets the aarch64 tests actually execute -- this
|
|
||||||
# job used to cross-compile them and then skip the test step, paying
|
|
||||||
# full codegen and link cost for a compile check.
|
|
||||||
- target: aarch64-pc-windows-msvc
|
|
||||||
runner: windows-11-arm
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: rust/lancedb
|
working-directory: rust/lancedb
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- name: Set target
|
- name: Set target
|
||||||
run: rustup target add ${{ matrix.target }}
|
run: rustup target add ${{ matrix.target }}
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install Protoc v21.12
|
- name: Install Protoc v21.12
|
||||||
run: choco install --no-progress protoc
|
run: choco install --no-progress protoc
|
||||||
- name: Build
|
- name: Build
|
||||||
@@ -268,12 +192,11 @@ jobs:
|
|||||||
$env:VCPKG_ROOT = $env:VCPKG_INSTALLATION_ROOT
|
$env:VCPKG_ROOT = $env:VCPKG_INSTALLATION_ROOT
|
||||||
cargo build --profile ci --features aws,remote --tests --locked --target ${{ matrix.target }}
|
cargo build --profile ci --features aws,remote --tests --locked --target ${{ matrix.target }}
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
# Can only run tests when target matches host
|
||||||
|
if: ${{ matrix.target == 'x86_64-pc-windows-msvc' }}
|
||||||
run: |
|
run: |
|
||||||
$env:VCPKG_ROOT = $env:VCPKG_INSTALLATION_ROOT
|
$env:VCPKG_ROOT = $env:VCPKG_INSTALLATION_ROOT
|
||||||
# `--target` has to match the build step above. Without it cargo uses
|
cargo test --profile ci --features aws,remote --locked
|
||||||
# target/ci/ rather than target/<triple>/ci/ and rebuilds the entire
|
|
||||||
# dependency graph a second time.
|
|
||||||
cargo test --profile ci --features aws,remote --locked --target ${{ matrix.target }}
|
|
||||||
|
|
||||||
msrv:
|
msrv:
|
||||||
# Check the minimum supported Rust version
|
# Check the minimum supported Rust version
|
||||||
@@ -287,7 +210,7 @@ jobs:
|
|||||||
CC: clang-18
|
CC: clang-18
|
||||||
CXX: clang++-18
|
CXX: clang++-18
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -299,11 +222,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.msrv }}
|
toolchain: ${{ matrix.msrv }}
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Downgrade dependencies
|
- name: Downgrade dependencies
|
||||||
# These packages have newer requirements for MSRV
|
# These packages have newer requirements for MSRV
|
||||||
run: |
|
run: |
|
||||||
@@ -324,18 +242,16 @@ jobs:
|
|||||||
cargo update -p aws-types --precise 1.3.9
|
cargo update -p aws-types --precise 1.3.9
|
||||||
cargo update -p aws-sigv4 --precise 1.3.5
|
cargo update -p aws-sigv4 --precise 1.3.5
|
||||||
cargo update -p aws-credential-types --precise 1.2.8
|
cargo update -p aws-credential-types --precise 1.2.8
|
||||||
# aws-smithy-checksums must stay at or above 0.63.13: OpenDAL's S3
|
cargo update -p aws-smithy-checksums --precise 0.63.9
|
||||||
# service needs crc-fast ~1.9, and older releases pin it to ~1.3.
|
|
||||||
cargo update -p aws-smithy-checksums --precise 0.63.13
|
|
||||||
cargo update -p aws-smithy-runtime --precise 1.9.3
|
cargo update -p aws-smithy-runtime --precise 1.9.3
|
||||||
cargo update -p aws-smithy-http --precise 0.62.6
|
cargo update -p aws-smithy-http --precise 0.62.4
|
||||||
cargo update -p aws-smithy-eventstream --precise 0.60.14
|
cargo update -p aws-smithy-eventstream --precise 0.60.12
|
||||||
cargo update -p aws-smithy-http-client --precise 1.1.3
|
cargo update -p aws-smithy-http-client --precise 1.1.3
|
||||||
cargo update -p aws-smithy-observability --precise 0.1.4
|
cargo update -p aws-smithy-observability --precise 0.1.4
|
||||||
cargo update -p aws-smithy-query --precise 0.60.8
|
cargo update -p aws-smithy-query --precise 0.60.8
|
||||||
cargo update -p aws-smithy-runtime-api --precise 1.9.3
|
cargo update -p aws-smithy-runtime-api --precise 1.9.1
|
||||||
cargo update -p aws-smithy-async --precise 1.2.7
|
cargo update -p aws-smithy-async --precise 1.2.6
|
||||||
cargo update -p aws-smithy-types --precise 1.3.6
|
cargo update -p aws-smithy-types --precise 1.3.5
|
||||||
cargo update -p aws-smithy-xml --precise 0.60.11
|
cargo update -p aws-smithy-xml --precise 0.60.11
|
||||||
cargo update -p home --precise 0.5.9
|
cargo update -p home --precise 0.5.9
|
||||||
- name: cargo +${{ matrix.msrv }} check
|
- name: cargo +${{ matrix.msrv }} check
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
name: Update package-lock.json
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: main
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
lfs: true
|
||||||
|
- uses: ./.github/workflows/update_package_lock
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.LANCEDB_RELEASE_TOKEN }}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
name: Update NodeJs package-lock.json
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: main
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
lfs: true
|
||||||
|
- uses: ./.github/workflows/update_package_lock_nodejs
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.LANCEDB_RELEASE_TOKEN }}
|
||||||
@@ -27,7 +27,6 @@ python/dist
|
|||||||
*.so
|
*.so
|
||||||
*.dylib
|
*.dylib
|
||||||
*.dll
|
*.dll
|
||||||
*.pdb
|
|
||||||
|
|
||||||
## Javascript
|
## Javascript
|
||||||
*.node
|
*.node
|
||||||
|
|||||||
@@ -20,10 +20,7 @@ repos:
|
|||||||
hooks:
|
hooks:
|
||||||
- id: local-biome-check
|
- id: local-biome-check
|
||||||
name: biome check
|
name: biome check
|
||||||
# Use the biome from nodejs/package.json rather than a separately
|
entry: npx @biomejs/biome@1.8.3 check --config-path nodejs/biome.json nodejs/
|
||||||
# pinned one: the two drifted apart and disagreed on formatting, so
|
|
||||||
# this hook rejected code that `pnpm lint` accepted.
|
|
||||||
entry: nodejs/node_modules/.bin/biome check --config-path nodejs/biome.json nodejs/
|
|
||||||
language: system
|
language: system
|
||||||
types: [text]
|
types: [text]
|
||||||
files: "nodejs/.*"
|
files: "nodejs/.*"
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ Common commands:
|
|||||||
* Run specific test: `cargo test --quiet --features remote -p <package_name> --test <test_name>`
|
* Run specific test: `cargo test --quiet --features remote -p <package_name> --test <test_name>`
|
||||||
* Lint: `cargo clippy --quiet --features remote --tests --examples`
|
* Lint: `cargo clippy --quiet --features remote --tests --examples`
|
||||||
* Format Rust: `cargo fmt --all`
|
* Format Rust: `cargo fmt --all`
|
||||||
* Use repository-defined Cargo profiles instead of ad hoc LTO overrides.
|
|
||||||
* Use `release-with-debug` for benchmarks and profiling so optimized builds keep debug symbols without a rebuild.
|
|
||||||
* Use `release-no-lto` only for local debugging, IO-bound benchmarks, or compile-time-sensitive performance investigation where LTO would not affect the measured bottleneck.
|
|
||||||
* Format Python: `ruff format .`
|
* Format Python: `ruff format .`
|
||||||
* Lint Python: `ruff check .`
|
* Lint Python: `ruff check .`
|
||||||
* Bootstrap Python dev env: `cd python && uv run --extra tests --extra dev maturin develop --extras tests,dev`
|
* Bootstrap Python dev env: `cd python && uv run --extra tests --extra dev maturin develop --extras tests,dev`
|
||||||
@@ -38,7 +35,7 @@ Before committing changes, run formatting for every language you touched. At min
|
|||||||
* Rust changes: run `cargo fmt --all`.
|
* Rust changes: run `cargo fmt --all`.
|
||||||
* Python changes: run `ruff format .` and `ruff check .` from the repository root,
|
* Python changes: run `ruff format .` and `ruff check .` from the repository root,
|
||||||
and run targeted tests through `cd python && uv run ...`.
|
and run targeted tests through `cd python && uv run ...`.
|
||||||
* TypeScript changes: run the relevant `pnpm` lint, format, build, and docs commands in `nodejs`.
|
* TypeScript changes: run the relevant `npm`/`pnpm` lint, format, build, and docs commands in `nodejs`.
|
||||||
|
|
||||||
Before creating a PR, the exact value passed to `gh pr create --title` must follow
|
Before creating a PR, the exact value passed to `gh pr create --title` must follow
|
||||||
Conventional Commits, such as `fix: support nested field paths in native index creation`
|
Conventional Commits, such as `fix: support nested field paths in native index creation`
|
||||||
@@ -95,45 +92,16 @@ Python bindings changes:
|
|||||||
* Should use `LOOP.run()` to call the corresponding `AsyncTable` method.
|
* Should use `LOOP.run()` to call the corresponding `AsyncTable` method.
|
||||||
6. Add concrete sync method to `RemoteTable` class in `python/python/lancedb/remote/table.py`.
|
6. Add concrete sync method to `RemoteTable` class in `python/python/lancedb/remote/table.py`.
|
||||||
7. Add unit test in `python/tests/test_table.py`.
|
7. Add unit test in `python/tests/test_table.py`.
|
||||||
8. If you added a new public class or module-level function (not just a method on an
|
|
||||||
existing class), expose it in the API reference. See "Python API reference" below.
|
|
||||||
|
|
||||||
TypeScript bindings changes:
|
TypeScript bindings changes:
|
||||||
|
|
||||||
1. Add napi-rs method binding on `Table` in `nodejs/src/table.rs`.
|
1. Add napi-rs method binding on `Table` in `nodejs/src/table.rs`.
|
||||||
2. Run `pnpm build` to generate TypeScript definitions.
|
2. Run `npm run build` to generate TypeScript definitions.
|
||||||
3. Add typescript method on abstract class `Table` in `nodejs/src/table.ts`.
|
3. Add typescript method on abstract class `Table` in `nodejs/src/table.ts`.
|
||||||
4. Add concrete method on `LocalTable` class in `nodejs/src/native_table.ts`.
|
4. Add concrete method on `LocalTable` class in `nodejs/src/native_table.ts`.
|
||||||
* Note: despite the name, this class is also used for remote tables.
|
* Note: despite the name, this class is also used for remote tables.
|
||||||
5. Add test in `nodejs/__test__/table.test.ts`.
|
5. Add test in `nodejs/__test__/table.test.ts`.
|
||||||
6. Run `pnpm run docs` to generate TypeScript documentation.
|
6. Run `npm run docs` to generate TypeScript documentation.
|
||||||
|
|
||||||
## Python API reference
|
|
||||||
|
|
||||||
`docs/src/python/python.md` is the entire Python API reference. It is maintained by
|
|
||||||
hand, and anything not listed there is not rendered at all, so new public classes and
|
|
||||||
module-level functions have to be added explicitly. How depends on the module:
|
|
||||||
|
|
||||||
* `lancedb.index`, `lancedb.embeddings`, `lancedb.remote`, and `lancedb.rerankers` are
|
|
||||||
rendered by a single directive each, driven by the module's `__all__`. Add the new
|
|
||||||
name to `__all__` and it appears; forget, and it is silently omitted.
|
|
||||||
* Everything else (`lancedb`, `lancedb.table`, `lancedb.query`, `lancedb.db`, ...) is
|
|
||||||
listed symbol by symbol. Add a `::: lancedb.<module>.<Name>` line to the matching
|
|
||||||
section, and remember that the page separates synchronous and asynchronous APIs.
|
|
||||||
|
|
||||||
Deliberately undocumented: concrete implementations reached through an abstract base
|
|
||||||
(`LanceTable`, `LanceDBConnection`, `RemoteDBConnection`), query base classes already
|
|
||||||
covered by `inherited_members`, and internal helpers.
|
|
||||||
|
|
||||||
Cross-references in docstrings use mkdocstrings syntax, `[text][lancedb.table.Table]`.
|
|
||||||
Plain relative links such as `[Table](Table)` do not resolve. To check your work:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
pip install -r docs/requirements.txt
|
|
||||||
cd docs && PYTHONPATH=. mkdocs build
|
|
||||||
```
|
|
||||||
|
|
||||||
The docs site only builds on pushes to `main`, so this is not covered by PR CI.
|
|
||||||
|
|
||||||
## Review Guidelines
|
## Review Guidelines
|
||||||
|
|
||||||
|
|||||||
Generated
+638
-1395
File diff suppressed because it is too large
Load Diff
+26
-35
@@ -13,26 +13,24 @@ categories = ["database-implementations"]
|
|||||||
rust-version = "1.91.0"
|
rust-version = "1.91.0"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
lance = { "version" = "=12.0.0-beta.5", default-features = false, "tag" = "v12.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance = { "version" = "=7.1.0-beta.4", default-features = false, "tag" = "v7.1.0-beta.4", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-core = { "version" = "=12.0.0-beta.5", "tag" = "v12.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-core = { "version" = "=7.1.0-beta.4", "tag" = "v7.1.0-beta.4", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-datagen = { "version" = "=12.0.0-beta.5", "tag" = "v12.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-datagen = { "version" = "=7.1.0-beta.4", "tag" = "v7.1.0-beta.4", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-file = { "version" = "=12.0.0-beta.5", "tag" = "v12.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-file = { "version" = "=7.1.0-beta.4", "tag" = "v7.1.0-beta.4", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-io = { "version" = "=12.0.0-beta.5", default-features = false, "tag" = "v12.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-io = { "version" = "=7.1.0-beta.4", default-features = false, "tag" = "v7.1.0-beta.4", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-index = { "version" = "=12.0.0-beta.5", "tag" = "v12.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-index = { "version" = "=7.1.0-beta.4", "tag" = "v7.1.0-beta.4", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-linalg = { "version" = "=12.0.0-beta.5", "tag" = "v12.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-linalg = { "version" = "=7.1.0-beta.4", "tag" = "v7.1.0-beta.4", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-namespace = { "version" = "=12.0.0-beta.5", "tag" = "v12.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-namespace = { "version" = "=7.1.0-beta.4", "tag" = "v7.1.0-beta.4", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-namespace-impls = { "version" = "=12.0.0-beta.5", default-features = false, "tag" = "v12.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-namespace-impls = { "version" = "=7.1.0-beta.4", default-features = false, "tag" = "v7.1.0-beta.4", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-table = { "version" = "=12.0.0-beta.5", "tag" = "v12.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-table = { "version" = "=7.1.0-beta.4", "tag" = "v7.1.0-beta.4", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-testing = { "version" = "=12.0.0-beta.5", "tag" = "v12.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-testing = { "version" = "=7.1.0-beta.4", "tag" = "v7.1.0-beta.4", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-datafusion = { "version" = "=12.0.0-beta.5", "tag" = "v12.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-datafusion = { "version" = "=7.1.0-beta.4", "tag" = "v7.1.0-beta.4", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-encoding = { "version" = "=12.0.0-beta.5", "tag" = "v12.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-encoding = { "version" = "=7.1.0-beta.4", "tag" = "v7.1.0-beta.4", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-arrow = { "version" = "=12.0.0-beta.5", "tag" = "v12.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-arrow = { "version" = "=7.1.0-beta.4", "tag" = "v7.1.0-beta.4", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lancedb = { path = "rust/lancedb", default-features = false }
|
|
||||||
ahash = "0.8"
|
ahash = "0.8"
|
||||||
# Note that this one does not include pyarrow
|
# Note that this one does not include pyarrow
|
||||||
arrow = { version = "58.0.0", optional = false }
|
arrow = { version = "58.0.0", optional = false }
|
||||||
arrow-array = "58.0.0"
|
arrow-array = "58.0.0"
|
||||||
arrow-buffer = "58.0.0"
|
|
||||||
arrow-data = "58.0.0"
|
arrow-data = "58.0.0"
|
||||||
arrow-ipc = "58.0.0"
|
arrow-ipc = "58.0.0"
|
||||||
arrow-ord = "58.0.0"
|
arrow-ord = "58.0.0"
|
||||||
@@ -40,24 +38,21 @@ arrow-schema = "58.0.0"
|
|||||||
arrow-select = "58.0.0"
|
arrow-select = "58.0.0"
|
||||||
arrow-cast = "58.0.0"
|
arrow-cast = "58.0.0"
|
||||||
async-trait = "0"
|
async-trait = "0"
|
||||||
bytes = "1"
|
datafusion = { version = "53.0.0", default-features = false }
|
||||||
datafusion = { version = "54.0.0", default-features = false }
|
datafusion-catalog = "53.0.0"
|
||||||
datafusion-catalog = "54.0.0"
|
datafusion-common = { version = "53.0.0", default-features = false }
|
||||||
datafusion-common = { version = "54.0.0", default-features = false }
|
datafusion-execution = "53.0.0"
|
||||||
datafusion-execution = "54.0.0"
|
datafusion-expr = "53.0.0"
|
||||||
datafusion-expr = "54.0.0"
|
datafusion-functions = "53.0.0"
|
||||||
datafusion-functions = "54.0.0"
|
datafusion-physical-plan = "53.0.0"
|
||||||
datafusion-physical-plan = "54.0.0"
|
datafusion-physical-expr = "53.0.0"
|
||||||
datafusion-physical-expr = "54.0.0"
|
datafusion-sql = "53.0.0"
|
||||||
datafusion-sql = "54.0.0"
|
|
||||||
env_logger = "0.11"
|
env_logger = "0.11"
|
||||||
half = { "version" = "2.7.1", default-features = false, features = [
|
half = { "version" = "2.7.1", default-features = false, features = [
|
||||||
"num-traits",
|
"num-traits",
|
||||||
] }
|
] }
|
||||||
futures = "0.3"
|
futures = "0"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
metrics = "0.24"
|
|
||||||
metrics-util = "0.19"
|
|
||||||
moka = { version = "0.12", features = ["future"] }
|
moka = { version = "0.12", features = ["future"] }
|
||||||
object_store = "0.13.2"
|
object_store = "0.13.2"
|
||||||
pin-project = "1.0.7"
|
pin-project = "1.0.7"
|
||||||
@@ -66,13 +61,9 @@ snafu = "0.8"
|
|||||||
url = "2"
|
url = "2"
|
||||||
num-traits = "0.2"
|
num-traits = "0.2"
|
||||||
regex = "1.10"
|
regex = "1.10"
|
||||||
|
lazy_static = "1"
|
||||||
semver = "1.0.25"
|
semver = "1.0.25"
|
||||||
serde = "1"
|
chrono = "0.4"
|
||||||
serde_json = "1"
|
|
||||||
tempfile = "3.5.0"
|
|
||||||
tokio = { version = "1.23", features = ["rt-multi-thread", "sync"] }
|
|
||||||
uuid = { version = "1.7.0", features = ["v4"] }
|
|
||||||
chrono = { version = "0.4", default-features = false, features = ["clock"] }
|
|
||||||
|
|
||||||
[profile.ci]
|
[profile.ci]
|
||||||
debug = "line-tables-only"
|
debug = "line-tables-only"
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ licenses:
|
|||||||
cd python && cargo about generate ../about.hbs -o RUST_THIRD_PARTY_LICENSES.html -c ../about.toml
|
cd python && cargo about generate ../about.hbs -o RUST_THIRD_PARTY_LICENSES.html -c ../about.toml
|
||||||
cd python && uv sync --all-extras && uv tool run pip-licenses --python .venv/bin/python --format=markdown --with-urls --output-file=PYTHON_THIRD_PARTY_LICENSES.md
|
cd python && uv sync --all-extras && uv tool run pip-licenses --python .venv/bin/python --format=markdown --with-urls --output-file=PYTHON_THIRD_PARTY_LICENSES.md
|
||||||
cd nodejs && cargo about generate ../about.hbs -o RUST_THIRD_PARTY_LICENSES.html -c ../about.toml
|
cd nodejs && cargo about generate ../about.hbs -o RUST_THIRD_PARTY_LICENSES.html -c ../about.toml
|
||||||
cd nodejs && pnpm dlx license-checker@25 --markdown --out NODEJS_THIRD_PARTY_LICENSES.md
|
cd nodejs && npx license-checker --markdown --out NODEJS_THIRD_PARTY_LICENSES.md
|
||||||
cd java && ./mvnw license:aggregate-add-third-party -q
|
cd java && ./mvnw license:aggregate-add-third-party -q
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
# Code review guidelines
|
|
||||||
|
|
||||||
Repo-specific guidance for automated PR reviews.
|
|
||||||
|
|
||||||
## Cross-SDK parity
|
|
||||||
|
|
||||||
LanceDB exposes the same core (`rust/lancedb`) through Python, TypeScript (`nodejs`),
|
|
||||||
and Java bindings. Behavioral drift between SDKs is a recurring problem, so watch for
|
|
||||||
parity gaps when reviewing — but only flag real ones:
|
|
||||||
|
|
||||||
* If the change adds or modifies user-facing API or behavior in the shared core
|
|
||||||
(`rust/lancedb`), check whether each binding that should expose it (`python`,
|
|
||||||
`nodejs`) does. A core change with no corresponding binding update is worth a note.
|
|
||||||
* If the change adds or modifies a public API in one SDK but not the other, open the
|
|
||||||
sibling SDK's corresponding module and state whether an equivalent exists. If not,
|
|
||||||
note it as a possible parity gap and suggest a follow-up issue.
|
|
||||||
* For bug fixes, first read the sibling SDK's analogous code path to check whether the
|
|
||||||
same bug exists there. Only raise parity if it actually does. Do not ask to "port" a
|
|
||||||
fix for a bug that only ever existed in one binding.
|
|
||||||
* Stay silent on internal-only refactors, tests, docs, and changes with no cross-SDK
|
|
||||||
surface.
|
|
||||||
* Parity expectations apply to the Python and TypeScript (`nodejs`) SDKs. Java currently
|
|
||||||
implements only the remote table, not the local/embedded backend, so it is expected to
|
|
||||||
be partial — do not flag Java for missing local-only functionality.
|
|
||||||
* Keep parity feedback to a short, clearly-labeled note (e.g. "Possible SDK parity
|
|
||||||
gap: …"). It is advisory, not a merge blocker.
|
|
||||||
+3
-3
@@ -2,9 +2,9 @@ set -e
|
|||||||
|
|
||||||
RELEASE_TYPE=${1:-"stable"}
|
RELEASE_TYPE=${1:-"stable"}
|
||||||
BUMP_MINOR=${2:-false}
|
BUMP_MINOR=${2:-false}
|
||||||
HEAD_SHA=$(git rev-parse HEAD)
|
TAG_PREFIX=${3:-"v"} # Such as "python-v"
|
||||||
|
HEAD_SHA=${4:-$(git rev-parse HEAD)}
|
||||||
|
|
||||||
readonly TAG_PREFIX="v"
|
|
||||||
readonly SELF_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
readonly SELF_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
|
|
||||||
PREV_TAG=$(git tag --sort='version:refname' | grep ^$TAG_PREFIX | python $SELF_DIR/semver_sort.py $TAG_PREFIX | tail -n 1)
|
PREV_TAG=$(git tag --sort='version:refname' | grep ^$TAG_PREFIX | python $SELF_DIR/semver_sort.py $TAG_PREFIX | tail -n 1)
|
||||||
@@ -12,7 +12,7 @@ echo "Found previous tag $PREV_TAG"
|
|||||||
|
|
||||||
# Initially, we don't want to tag if we are doing stable, because we will bump
|
# Initially, we don't want to tag if we are doing stable, because we will bump
|
||||||
# again later. See comment at end for why.
|
# again later. See comment at end for why.
|
||||||
if [[ "$RELEASE_TYPE" == 'stable' ]]; then
|
if [[ "$RELEASE_TYPE" == 'stable' ]]; then
|
||||||
BUMP_ARGS="--no-tag"
|
BUMP_ARGS="--no-tag"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
Check whether there are any breaking changes in the PRs between the base and head commits.
|
Check whether there are any breaking changes in the PRs between the base and head commits.
|
||||||
If there are, assert that we have incremented the minor version.
|
If there are, assert that we have incremented the minor version.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
from packaging.version import parse
|
from packaging.version import parse
|
||||||
@@ -28,7 +27,7 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
print("No breaking changes found.")
|
print("No breaking changes found.")
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
last_stable_version = parse(args.last_stable_version)
|
last_stable_version = parse(args.last_stable_version)
|
||||||
current_version = parse(args.current_version)
|
current_version = parse(args.current_version)
|
||||||
if current_version.minor <= last_stable_version.minor:
|
if current_version.minor <= last_stable_version.minor:
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""Determine whether a newer Lance tag exists and expose results for CI."""
|
"""Determine whether a newer Lance tag exists and expose results for CI."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
@@ -37,16 +36,8 @@ class SemVer:
|
|||||||
prerelease: Tuple[Union[int, str], ...]
|
prerelease: Tuple[Union[int, str], ...]
|
||||||
|
|
||||||
def __lt__(self, other: "SemVer") -> bool: # pragma: no cover - simple comparison
|
def __lt__(self, other: "SemVer") -> bool: # pragma: no cover - simple comparison
|
||||||
if (self.major, self.minor, self.patch) != (
|
if (self.major, self.minor, self.patch) != (other.major, other.minor, other.patch):
|
||||||
other.major,
|
return (self.major, self.minor, self.patch) < (other.major, other.minor, other.patch)
|
||||||
other.minor,
|
|
||||||
other.patch,
|
|
||||||
):
|
|
||||||
return (self.major, self.minor, self.patch) < (
|
|
||||||
other.major,
|
|
||||||
other.minor,
|
|
||||||
other.patch,
|
|
||||||
)
|
|
||||||
if self.prerelease == other.prerelease:
|
if self.prerelease == other.prerelease:
|
||||||
return False
|
return False
|
||||||
if not self.prerelease:
|
if not self.prerelease:
|
||||||
@@ -151,9 +142,7 @@ def read_current_version(repo_root: Path) -> str:
|
|||||||
deps = data["workspace"]["dependencies"]
|
deps = data["workspace"]["dependencies"]
|
||||||
entry = deps["lance"]
|
entry = deps["lance"]
|
||||||
except KeyError as exc: # pragma: no cover - configuration guard
|
except KeyError as exc: # pragma: no cover - configuration guard
|
||||||
raise RuntimeError(
|
raise RuntimeError("Failed to locate workspace.dependencies.lance in Cargo.toml") from exc
|
||||||
"Failed to locate workspace.dependencies.lance in Cargo.toml"
|
|
||||||
) from exc
|
|
||||||
|
|
||||||
if isinstance(entry, str):
|
if isinstance(entry, str):
|
||||||
raw_version = entry
|
raw_version = entry
|
||||||
|
|||||||
+6
-9
@@ -1,7 +1,6 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
# SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
# SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
||||||
"""A zero-dependency mock OpenAI embeddings API endpoint for testing purposes."""
|
"""A zero-dependency mock OpenAI embeddings API endpoint for testing purposes."""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
import http.server
|
import http.server
|
||||||
@@ -23,13 +22,11 @@ class MockOpenAIRequestHandler(http.server.BaseHTTPRequestHandler):
|
|||||||
|
|
||||||
data = []
|
data = []
|
||||||
for i in range(num_inputs):
|
for i in range(num_inputs):
|
||||||
data.append(
|
data.append({
|
||||||
{
|
"object": "embedding",
|
||||||
"object": "embedding",
|
"embedding": [0.1] * 1536,
|
||||||
"embedding": [0.1] * 1536,
|
"index": i,
|
||||||
"index": i,
|
})
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
response = {
|
response = {
|
||||||
"object": "list",
|
"object": "list",
|
||||||
@@ -38,7 +35,7 @@ class MockOpenAIRequestHandler(http.server.BaseHTTPRequestHandler):
|
|||||||
"usage": {
|
"usage": {
|
||||||
"prompt_tokens": 0,
|
"prompt_tokens": 0,
|
||||||
"total_tokens": 0,
|
"total_tokens": 0,
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.send_response(200)
|
self.send_response(200)
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ from packaging.version import parse, InvalidVersion
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("prefix", default="v")
|
parser.add_argument("prefix", default="v")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ def run_command(command: str) -> str:
|
|||||||
def get_latest_stable_version() -> str:
|
def get_latest_stable_version() -> str:
|
||||||
version_line = run_command("cargo info lance | grep '^version:'")
|
version_line = run_command("cargo info lance | grep '^version:'")
|
||||||
# Example output: "version: 0.35.0 (latest 0.37.0)"
|
# Example output: "version: 0.35.0 (latest 0.37.0)"
|
||||||
match = re.search(r"\(latest ([0-9.]+)\)", version_line)
|
match = re.search(r'\(latest ([0-9.]+)\)', version_line)
|
||||||
if match:
|
if match:
|
||||||
return match.group(1)
|
return match.group(1)
|
||||||
# Fallback: use the first version after 'version:'
|
# Fallback: use the first version after 'version:'
|
||||||
@@ -69,7 +69,7 @@ def extract_default_features(line: str) -> bool:
|
|||||||
"""
|
"""
|
||||||
import re
|
import re
|
||||||
|
|
||||||
match = re.search(r"default-features\s*=\s*false", line)
|
match = re.search(r'default-features\s*=\s*false', line)
|
||||||
return match is not None
|
return match is not None
|
||||||
|
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ def dict_to_toml_line(package_name: str, config: dict) -> str:
|
|||||||
# This shouldn't happen with our current usage
|
# This shouldn't happen with our current usage
|
||||||
parts.append(f'"{key}" = {json.dumps(value)}')
|
parts.append(f'"{key}" = {json.dumps(value)}')
|
||||||
|
|
||||||
return f"{package_name} = {{ {', '.join(parts)} }}\n"
|
return f'{package_name} = {{ {", ".join(parts)} }}\n'
|
||||||
|
|
||||||
|
|
||||||
def update_cargo_toml(line_updater):
|
def update_cargo_toml(line_updater):
|
||||||
@@ -119,7 +119,7 @@ def update_cargo_toml(line_updater):
|
|||||||
lance_line = ""
|
lance_line = ""
|
||||||
is_parsing_lance_line = False
|
is_parsing_lance_line = False
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if re.match(r"^lance(?:\s|[-_])", line):
|
if line.startswith("lance"):
|
||||||
# Check if this is a single-line or multi-line entry
|
# Check if this is a single-line or multi-line entry
|
||||||
# Single-line entries either:
|
# Single-line entries either:
|
||||||
# 1. End with } (complete inline table)
|
# 1. End with } (complete inline table)
|
||||||
|
|||||||
@@ -1,185 +0,0 @@
|
|||||||
import os
|
|
||||||
import stat
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
import tempfile
|
|
||||||
import textwrap
|
|
||||||
import unittest
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
|
|
||||||
REPO_ROOT = Path(__file__).resolve().parents[2]
|
|
||||||
SCRIPT = REPO_ROOT / "ci" / "set_lance_version.py"
|
|
||||||
LANCE_GIT_URL = "https://github.com/lance-format/lance.git"
|
|
||||||
|
|
||||||
CARGO_TOML = """\
|
|
||||||
[workspace.dependencies]
|
|
||||||
lance = { "version" = "=1.0.0", default-features = false, "features" = ["dynamodb"] }
|
|
||||||
lance-core = "1.0.0"
|
|
||||||
lance_datafusion = {
|
|
||||||
"version" = "=1.0.0",
|
|
||||||
"features" = ["substrait"]
|
|
||||||
}
|
|
||||||
lancedb = { path = "rust/lancedb", default-features = false }
|
|
||||||
lancedb-common = { path = "rust/lancedb-common" }
|
|
||||||
lancewood = "1.0.0"
|
|
||||||
my-lance = "1.0.0"
|
|
||||||
"""
|
|
||||||
|
|
||||||
UNTOUCHED_DEPENDENCIES = """\
|
|
||||||
lancedb = { path = "rust/lancedb", default-features = false }
|
|
||||||
lancedb-common = { path = "rust/lancedb-common" }
|
|
||||||
lancewood = "1.0.0"
|
|
||||||
my-lance = "1.0.0"
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
class SetLanceVersionTest(unittest.TestCase):
|
|
||||||
def test_supported_update_modes_only_rewrite_lance_dependencies(self):
|
|
||||||
cases = {
|
|
||||||
"stable": (
|
|
||||||
"""\
|
|
||||||
lance = { "version" = "=9.9.9", default-features = false, "features" = ["dynamodb"] }
|
|
||||||
lance-core = "=9.9.9"
|
|
||||||
lance_datafusion = { "version" = "=9.9.9", "features" = ["substrait"] }
|
|
||||||
""",
|
|
||||||
["cargo info lance", "cargo metadata"],
|
|
||||||
),
|
|
||||||
"preview": (
|
|
||||||
f"""\
|
|
||||||
lance = {{ "version" = "=10.0.0-beta.3", default-features = false, "features" = ["dynamodb"], "tag" = "v10.0.0-beta.3", "git" = "{LANCE_GIT_URL}" }}
|
|
||||||
lance-core = {{ "version" = "=10.0.0-beta.3", "tag" = "v10.0.0-beta.3", "git" = "{LANCE_GIT_URL}" }}
|
|
||||||
lance_datafusion = {{ "version" = "=10.0.0-beta.3", "features" = ["substrait"], "tag" = "v10.0.0-beta.3", "git" = "{LANCE_GIT_URL}" }}
|
|
||||||
""",
|
|
||||||
["git ls-remote --tags", "cargo metadata"],
|
|
||||||
),
|
|
||||||
"local": (
|
|
||||||
"""\
|
|
||||||
lance = { "path" = "../lance/rust/lance", default-features = false, "features" = ["dynamodb"] }
|
|
||||||
lance-core = { "path" = "../lance/rust/lance-core" }
|
|
||||||
lance_datafusion = { "path" = "../lance/rust/lance_datafusion", "features" = ["substrait"] }
|
|
||||||
""",
|
|
||||||
["cargo metadata"],
|
|
||||||
),
|
|
||||||
"v8.1.2": (
|
|
||||||
"""\
|
|
||||||
lance = { "version" = "=8.1.2", default-features = false, "features" = ["dynamodb"] }
|
|
||||||
lance-core = "=8.1.2"
|
|
||||||
lance_datafusion = { "version" = "=8.1.2", "features" = ["substrait"] }
|
|
||||||
""",
|
|
||||||
["cargo metadata"],
|
|
||||||
),
|
|
||||||
"v8.2.0-beta.4": (
|
|
||||||
f"""\
|
|
||||||
lance = {{ "version" = "=8.2.0-beta.4", default-features = false, "features" = ["dynamodb"], "tag" = "v8.2.0-beta.4", "git" = "{LANCE_GIT_URL}" }}
|
|
||||||
lance-core = {{ "version" = "=8.2.0-beta.4", "tag" = "v8.2.0-beta.4", "git" = "{LANCE_GIT_URL}" }}
|
|
||||||
lance_datafusion = {{ "version" = "=8.2.0-beta.4", "features" = ["substrait"], "tag" = "v8.2.0-beta.4", "git" = "{LANCE_GIT_URL}" }}
|
|
||||||
""",
|
|
||||||
["cargo metadata"],
|
|
||||||
),
|
|
||||||
}
|
|
||||||
|
|
||||||
for version, (updated_dependencies, expected_commands) in cases.items():
|
|
||||||
with self.subTest(version=version), tempfile.TemporaryDirectory() as tmp:
|
|
||||||
workdir = Path(tmp)
|
|
||||||
(workdir / "Cargo.toml").write_text(CARGO_TOML)
|
|
||||||
command_log = workdir / "commands.log"
|
|
||||||
fake_bin = workdir / "bin"
|
|
||||||
fake_bin.mkdir()
|
|
||||||
self._write_fake_executables(fake_bin)
|
|
||||||
self._write_fake_python_dependencies(workdir)
|
|
||||||
|
|
||||||
env = os.environ.copy()
|
|
||||||
env["PATH"] = os.pathsep.join([str(fake_bin), env["PATH"]])
|
|
||||||
env["FAKE_COMMAND_LOG"] = str(command_log)
|
|
||||||
env["PYTHONPATH"] = os.pathsep.join(
|
|
||||||
filter(None, [str(workdir), env.get("PYTHONPATH")])
|
|
||||||
)
|
|
||||||
result = subprocess.run(
|
|
||||||
[sys.executable, str(SCRIPT), version],
|
|
||||||
cwd=workdir,
|
|
||||||
env=env,
|
|
||||||
capture_output=True,
|
|
||||||
text=True,
|
|
||||||
timeout=10,
|
|
||||||
)
|
|
||||||
|
|
||||||
self.assertEqual(result.returncode, 0, result.stderr)
|
|
||||||
self.assertEqual(
|
|
||||||
(workdir / "Cargo.toml").read_text(),
|
|
||||||
"[workspace.dependencies]\n"
|
|
||||||
+ updated_dependencies
|
|
||||||
+ UNTOUCHED_DEPENDENCIES,
|
|
||||||
)
|
|
||||||
commands = command_log.read_text().splitlines()
|
|
||||||
for command in expected_commands:
|
|
||||||
self.assertTrue(
|
|
||||||
any(line.startswith(command) for line in commands),
|
|
||||||
f"{command!r} not found in {commands!r}",
|
|
||||||
)
|
|
||||||
|
|
||||||
def _write_fake_executables(self, fake_bin: Path) -> None:
|
|
||||||
cargo = fake_bin / "cargo"
|
|
||||||
cargo.write_text(
|
|
||||||
textwrap.dedent(
|
|
||||||
"""\
|
|
||||||
#!/bin/sh
|
|
||||||
printf 'cargo %s\\n' "$*" >> "$FAKE_COMMAND_LOG"
|
|
||||||
case "$1" in
|
|
||||||
info)
|
|
||||||
printf '%s\\n' 'version: 8.8.8 (latest 9.9.9)'
|
|
||||||
;;
|
|
||||||
metadata)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
exit 2
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
)
|
|
||||||
cargo.chmod(cargo.stat().st_mode | stat.S_IXUSR)
|
|
||||||
|
|
||||||
git = fake_bin / "git"
|
|
||||||
git.write_text(
|
|
||||||
textwrap.dedent(
|
|
||||||
"""\
|
|
||||||
#!/bin/sh
|
|
||||||
printf 'git %s\\n' "$*" >> "$FAKE_COMMAND_LOG"
|
|
||||||
if [ "$1" != "ls-remote" ]; then
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
printf '%s\\n' \\
|
|
||||||
'111111 refs/tags/v9.9.9' \\
|
|
||||||
'222222 refs/tags/v10.0.0-beta.1' \\
|
|
||||||
'333333 refs/tags/v10.0.0-beta.3'
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
)
|
|
||||||
git.chmod(git.stat().st_mode | stat.S_IXUSR)
|
|
||||||
|
|
||||||
def _write_fake_python_dependencies(self, workdir: Path) -> None:
|
|
||||||
packaging = workdir / "packaging"
|
|
||||||
packaging.mkdir()
|
|
||||||
(packaging / "__init__.py").write_text("")
|
|
||||||
(packaging / "version.py").write_text(
|
|
||||||
textwrap.dedent(
|
|
||||||
"""\
|
|
||||||
class Version:
|
|
||||||
def __init__(self, value):
|
|
||||||
release, _, prerelease = value.partition("-beta.")
|
|
||||||
self._key = (
|
|
||||||
tuple(int(part) for part in release.split(".")),
|
|
||||||
not prerelease,
|
|
||||||
int(prerelease or 0),
|
|
||||||
)
|
|
||||||
|
|
||||||
def __lt__(self, other):
|
|
||||||
return self._key < other._key
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
unittest.main()
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
"""Prepare a Lance dependency update for LanceDB."""
|
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
import json
|
|
||||||
import re
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
try:
|
|
||||||
from check_lance_release import parse_semver
|
|
||||||
except ModuleNotFoundError:
|
|
||||||
# Supports importing as ci.update_lance_dependency from tests or ad hoc checks.
|
|
||||||
from ci.check_lance_release import parse_semver # type: ignore
|
|
||||||
|
|
||||||
|
|
||||||
def normalize_version(raw: str) -> str:
|
|
||||||
value = raw.strip()
|
|
||||||
value = value.removeprefix("refs/tags/")
|
|
||||||
value = value.removeprefix("v")
|
|
||||||
try:
|
|
||||||
parse_semver(value)
|
|
||||||
except ValueError:
|
|
||||||
raise ValueError(f"Unsupported Lance version or tag: {raw}")
|
|
||||||
return value
|
|
||||||
|
|
||||||
|
|
||||||
def normalized_tag(version: str) -> str:
|
|
||||||
return f"v{version}"
|
|
||||||
|
|
||||||
|
|
||||||
def branch_name(version: str) -> str:
|
|
||||||
suffix = re.sub(r"[^a-zA-Z0-9]+", "-", version).strip("-")
|
|
||||||
suffix = re.sub(r"-+", "-", suffix)
|
|
||||||
return f"codex/update-lance-{suffix}"
|
|
||||||
|
|
||||||
|
|
||||||
def commit_type(version: str) -> str:
|
|
||||||
prerelease = version.split("-", maxsplit=1)[1] if "-" in version else ""
|
|
||||||
return "chore" if "beta" in prerelease or "rc" in prerelease else "feat"
|
|
||||||
|
|
||||||
|
|
||||||
def metadata_for(version: str) -> dict[str, str]:
|
|
||||||
kind = commit_type(version)
|
|
||||||
message = f"{kind}: update lance dependency to v{version}"
|
|
||||||
return {
|
|
||||||
"version": version,
|
|
||||||
"tag": normalized_tag(version),
|
|
||||||
"branch_name": branch_name(version),
|
|
||||||
"commit_type": kind,
|
|
||||||
"commit_message": message,
|
|
||||||
"pr_title": message,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def run_command(cmd: Sequence[str], *, cwd: Path) -> None:
|
|
||||||
subprocess.run(cmd, cwd=cwd, check=True)
|
|
||||||
|
|
||||||
|
|
||||||
def update_java_lance_core_version(repo_root: Path, version: str) -> None:
|
|
||||||
pom_path = repo_root / "java" / "pom.xml"
|
|
||||||
contents = pom_path.read_text(encoding="utf-8")
|
|
||||||
updated, count = re.subn(
|
|
||||||
r"(<lance-core\.version>)[^<]+(</lance-core\.version>)",
|
|
||||||
rf"\g<1>{version}\g<2>",
|
|
||||||
contents,
|
|
||||||
count=1,
|
|
||||||
)
|
|
||||||
if count != 1:
|
|
||||||
raise RuntimeError(
|
|
||||||
"Expected exactly one <lance-core.version> entry in java/pom.xml"
|
|
||||||
)
|
|
||||||
pom_path.write_text(updated, encoding="utf-8")
|
|
||||||
|
|
||||||
|
|
||||||
def write_github_outputs(path: str | None, payload: dict[str, str]) -> None:
|
|
||||||
if not path:
|
|
||||||
return
|
|
||||||
with open(path, "a", encoding="utf-8") as output:
|
|
||||||
for key, value in payload.items():
|
|
||||||
output.write(f"{key}={value}\n")
|
|
||||||
|
|
||||||
|
|
||||||
def main(argv: Sequence[str] | None = None) -> int:
|
|
||||||
parser = argparse.ArgumentParser(description=__doc__)
|
|
||||||
parser.add_argument(
|
|
||||||
"tag_or_version",
|
|
||||||
help="Lance tag or version, for example refs/tags/v7.2.0-beta.1 or 7.2.0",
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--repo-root",
|
|
||||||
type=Path,
|
|
||||||
default=Path(__file__).resolve().parents[1],
|
|
||||||
help="Path to the lancedb repository root",
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--github-output",
|
|
||||||
default=None,
|
|
||||||
help="Optional GitHub Actions output file to receive metadata fields",
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--metadata-only",
|
|
||||||
action="store_true",
|
|
||||||
help="Only print derived metadata; do not modify dependency files",
|
|
||||||
)
|
|
||||||
args = parser.parse_args(argv)
|
|
||||||
|
|
||||||
repo_root = args.repo_root.resolve()
|
|
||||||
version = normalize_version(args.tag_or_version)
|
|
||||||
payload = metadata_for(version)
|
|
||||||
|
|
||||||
if not args.metadata_only:
|
|
||||||
run_command([sys.executable, "ci/set_lance_version.py", version], cwd=repo_root)
|
|
||||||
update_java_lance_core_version(repo_root, version)
|
|
||||||
|
|
||||||
write_github_outputs(args.github_output, payload)
|
|
||||||
print(json.dumps(payload, sort_keys=True))
|
|
||||||
return 0
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
sys.exit(main())
|
|
||||||
@@ -12,12 +12,16 @@ done
|
|||||||
# This updates the lockfile without building
|
# This updates the lockfile without building
|
||||||
cargo metadata --quiet > /dev/null
|
cargo metadata --quiet > /dev/null
|
||||||
|
|
||||||
|
pushd nodejs || exit 1
|
||||||
|
npm install --package-lock-only --silent
|
||||||
|
popd
|
||||||
|
|
||||||
if git diff --quiet --exit-code; then
|
if git diff --quiet --exit-code; then
|
||||||
echo "No lockfile changes to commit; skipping amend."
|
echo "No lockfile changes to commit; skipping amend."
|
||||||
elif $AMEND; then
|
elif $AMEND; then
|
||||||
git add Cargo.lock
|
git add Cargo.lock nodejs/package-lock.json
|
||||||
git commit --amend --no-edit
|
git commit --amend --no-edit
|
||||||
else
|
else
|
||||||
git add Cargo.lock
|
git add Cargo.lock nodejs/package-lock.json
|
||||||
git commit -m "Update lockfiles"
|
git commit -m "Update lockfiles"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ with open("Cargo.toml", "rb") as f:
|
|||||||
elif isinstance(dep, dict):
|
elif isinstance(dep, dict):
|
||||||
# Version doesn't have the beta tag in it, so we instead look
|
# Version doesn't have the beta tag in it, so we instead look
|
||||||
# at the git tag.
|
# at the git tag.
|
||||||
version = dep.get("tag", dep.get("version"))
|
version = dep.get('tag', dep.get('version'))
|
||||||
else:
|
else:
|
||||||
raise ValueError("Unexpected type for dependency: " + str(dep))
|
raise ValueError("Unexpected type for dependency: " + str(dep))
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,18 @@ ignore = [
|
|||||||
# https://rustsec.org/advisories/RUSTSEC-2024-0436
|
# https://rustsec.org/advisories/RUSTSEC-2024-0436
|
||||||
{ id = "RUSTSEC-2024-0436", reason = "transitive via datafusion; awaiting ecosystem migration" },
|
{ id = "RUSTSEC-2024-0436", reason = "transitive via datafusion; awaiting ecosystem migration" },
|
||||||
|
|
||||||
|
# encoding: unmaintained. Reached through lindera-dictionary, which is
|
||||||
|
# required by the native Lindera tokenizer path. Lindera has not migrated
|
||||||
|
# off this crate yet.
|
||||||
|
# https://rustsec.org/advisories/RUSTSEC-2021-0153
|
||||||
|
{ id = "RUSTSEC-2021-0153", reason = "transitive via lindera-dictionary for native Lindera tokenizer" },
|
||||||
|
|
||||||
|
# fast-float: unsound and unmaintained. Reached only through polars-arrow
|
||||||
|
# from the optional Polars integration; replacement requires a Polars
|
||||||
|
# dependency upgrade.
|
||||||
|
# https://rustsec.org/advisories/RUSTSEC-2024-0379
|
||||||
|
{ id = "RUSTSEC-2024-0379", reason = "transitive via polars-arrow; waiting on Polars migration" },
|
||||||
|
|
||||||
# tantivy: segfault on malformed input due to missing bounds check.
|
# tantivy: segfault on malformed input due to missing bounds check.
|
||||||
# Pulled in via lance for full-text search. We only feed tantivy
|
# Pulled in via lance for full-text search. We only feed tantivy
|
||||||
# documents we construct ourselves, not attacker-controlled bytes.
|
# documents we construct ourselves, not attacker-controlled bytes.
|
||||||
@@ -68,6 +80,18 @@ ignore = [
|
|||||||
# https://rustsec.org/advisories/RUSTSEC-2025-0119
|
# https://rustsec.org/advisories/RUSTSEC-2025-0119
|
||||||
{ id = "RUSTSEC-2025-0119", reason = "transitive via hf-hub/indicatif; cosmetic formatting crate" },
|
{ id = "RUSTSEC-2025-0119", reason = "transitive via hf-hub/indicatif; cosmetic formatting crate" },
|
||||||
|
|
||||||
|
# bincode: unmaintained. Reached through lindera and lindera-dictionary,
|
||||||
|
# which are required by the native Lindera tokenizer path. Lindera has not
|
||||||
|
# migrated to another serialization format yet.
|
||||||
|
# https://rustsec.org/advisories/RUSTSEC-2025-0141
|
||||||
|
{ id = "RUSTSEC-2025-0141", reason = "transitive via lindera/lindera-dictionary for native Lindera tokenizer" },
|
||||||
|
|
||||||
|
# lru: soundness issue in IterMut. Reached only through aws-sdk-s3 in
|
||||||
|
# LanceDB's dev-dependency graph; LanceDB does not use that iterator
|
||||||
|
# directly. Clearing this requires the AWS SDK chain to update lru.
|
||||||
|
# https://rustsec.org/advisories/RUSTSEC-2026-0002
|
||||||
|
{ id = "RUSTSEC-2026-0002", reason = "transitive via aws-sdk-s3 dev-dependency; waiting on AWS SDK lru upgrade" },
|
||||||
|
|
||||||
# rustls-webpki 0.101.7 (old major line): name-constraint checks for
|
# rustls-webpki 0.101.7 (old major line): name-constraint checks for
|
||||||
# URI / wildcard names. Pulled in only via the legacy rustls 0.21 chain
|
# URI / wildcard names. Pulled in only via the legacy rustls 0.21 chain
|
||||||
# from aws-smithy-http-client. The 0.103 line we actively use is patched.
|
# from aws-smithy-http-client. The 0.103 line we actively use is patched.
|
||||||
@@ -84,36 +108,11 @@ ignore = [
|
|||||||
# https://rustsec.org/advisories/RUSTSEC-2026-0104
|
# https://rustsec.org/advisories/RUSTSEC-2026-0104
|
||||||
{ id = "RUSTSEC-2026-0104", reason = "only affects rustls-webpki 0.101 from legacy aws-smithy/rustls 0.21 chain" },
|
{ id = "RUSTSEC-2026-0104", reason = "only affects rustls-webpki 0.101 from legacy aws-smithy/rustls 0.21 chain" },
|
||||||
|
|
||||||
# pyo3 advisories in the Python bindings; tracked pending a patched pyo3 release.
|
# rand 0.8.5: soundness issue only when ThreadRng reseeds inside a custom
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2026-0176
|
# logger. Reached through several transitive chains. LanceDB does not use
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2026-0177
|
# rand from a custom logger; upgrade once all pinned chains accept 0.8.6+.
|
||||||
{ id = "RUSTSEC-2026-0176", reason = "pyo3 in Python bindings; awaiting patched pyo3 release" },
|
# https://rustsec.org/advisories/RUSTSEC-2026-0097
|
||||||
{ id = "RUSTSEC-2026-0177", reason = "pyo3 in Python bindings; awaiting patched pyo3 release" },
|
{ id = "RUSTSEC-2026-0097", reason = "transitive rand 0.8.5; LanceDB does not call ThreadRng from custom logging" },
|
||||||
|
|
||||||
# quick-xml < 0.41.0: quadratic runtime on duplicate attribute names (DoS).
|
|
||||||
# quick-xml < 0.41.0: unbounded namespace-declaration allocation in NsReader (DoS).
|
|
||||||
# Pulled in transitively by inferno (dev-only flame-graph dep), lance-namespace-impls
|
|
||||||
# (git dep from lance), and opendal/reqsign (cloud storage XML parsing). The XML
|
|
||||||
# parsed by opendal/reqsign comes from trusted cloud-storage endpoints (S3, GCS,
|
|
||||||
# Azure), not attacker-controlled input. Clearing requires upstream crates to migrate
|
|
||||||
# to quick-xml >= 0.41.0.
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2026-0194
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2026-0195
|
|
||||||
{ id = "RUSTSEC-2026-0194", reason = "transitive via inferno/lance/opendal; XML from trusted cloud endpoints, not attacker-controlled" },
|
|
||||||
{ id = "RUSTSEC-2026-0195", reason = "transitive via inferno/lance/opendal; XML from trusted cloud endpoints, not attacker-controlled" },
|
|
||||||
# smartstring: unmaintained — the repository was archived by its author on
|
|
||||||
# 2026-05-03. Not a vulnerability. Reached only transitively through polars
|
|
||||||
# (polars-core/-io/-ops/-time/-utils); nothing in LanceDB depends on it directly.
|
|
||||||
# The advisory states no safe upgrade is available: upstream recommends
|
|
||||||
# compact_str/smol_str, so clearing this requires polars to migrate.
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2026-0249
|
|
||||||
{ id = "RUSTSEC-2026-0249", reason = "smartstring unmaintained via polars; no fixed upstream release" },
|
|
||||||
|
|
||||||
# h2 0.3: empty DATA frames can be queued without limit. The patched
|
|
||||||
# h2 0.4 line is locked to 0.4.16, but no patched 0.3 release exists.
|
|
||||||
# The old copy is pulled in by aws-smithy's legacy hyper 0.14 client.
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2026-0258
|
|
||||||
{ id = "RUSTSEC-2026-0258", reason = "h2 0.3 via legacy aws-smithy/hyper 0.14; no patched 0.3 release" },
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
@@ -131,21 +130,23 @@ allow = [
|
|||||||
"BSD-3-Clause",
|
"BSD-3-Clause",
|
||||||
"ISC",
|
"ISC",
|
||||||
"Unicode-3.0",
|
"Unicode-3.0",
|
||||||
|
"Unicode-DFS-2016",
|
||||||
"Zlib",
|
"Zlib",
|
||||||
"CC0-1.0",
|
"CC0-1.0",
|
||||||
"MPL-2.0",
|
"MPL-2.0",
|
||||||
"BSL-1.0",
|
"BSL-1.0",
|
||||||
|
"OpenSSL",
|
||||||
# 0BSD ("BSD Zero Clause") is effectively public domain — no attribution
|
# 0BSD ("BSD Zero Clause") is effectively public domain — no attribution
|
||||||
# required. Pulled in by `mock_instant`.
|
# required. Pulled in by `mock_instant`.
|
||||||
"0BSD",
|
"0BSD",
|
||||||
|
# bzip2-1.0.6 is the permissive upstream bzip2 license (BSD-like). Pulled
|
||||||
|
# in by `libbz2-rs-sys`, the pure-Rust bzip2 implementation.
|
||||||
|
"bzip2-1.0.6",
|
||||||
# CDLA-Permissive-2.0 is a permissive data license used by `webpki-roots`
|
# CDLA-Permissive-2.0 is a permissive data license used by `webpki-roots`
|
||||||
# for the Mozilla CA root bundle. Data-only, distribution-compatible.
|
# for the Mozilla CA root bundle. Data-only, distribution-compatible.
|
||||||
"CDLA-Permissive-2.0",
|
"CDLA-Permissive-2.0",
|
||||||
]
|
]
|
||||||
confidence-threshold = 0.8
|
confidence-threshold = 0.8
|
||||||
# Per-crate license exceptions: allow a license for a specific crate only,
|
|
||||||
# rather than globally via the `allow` list above.
|
|
||||||
exceptions = []
|
|
||||||
# Crates whose license cannot be determined from Cargo metadata but whose
|
# Crates whose license cannot be determined from Cargo metadata but whose
|
||||||
# license we've manually confirmed from upstream. Keep this list minimal.
|
# license we've manually confirmed from upstream. Keep this list minimal.
|
||||||
[[licenses.clarify]]
|
[[licenses.clarify]]
|
||||||
@@ -167,11 +168,6 @@ multiple-versions = "warn"
|
|||||||
# Wildcard version requirements (`foo = "*"`) are a footgun — they let any
|
# Wildcard version requirements (`foo = "*"`) are a footgun — they let any
|
||||||
# future release in without review. Ban them outright.
|
# future release in without review. Ban them outright.
|
||||||
wildcards = "deny"
|
wildcards = "deny"
|
||||||
# Lint every dependency declared by a workspace member against the shared
|
|
||||||
# `[workspace.dependencies]` table: any crate used by more than one member must
|
|
||||||
# go through `workspace = true`, and entries nothing uses are an error. This
|
|
||||||
# keeps versions from drifting between the core crate and the bindings.
|
|
||||||
workspace-dependencies = { duplicates = "deny", unused = "deny" }
|
|
||||||
# Internal workspace crates reference each other via `path = "..."`, which
|
# Internal workspace crates reference each other via `path = "..."`, which
|
||||||
# cargo-deny sees as a wildcard version. That's fine for private workspace
|
# cargo-deny sees as a wildcard version. That's fine for private workspace
|
||||||
# members (not published to crates.io), so allow it specifically for paths.
|
# members (not published to crates.io), so allow it specifically for paths.
|
||||||
|
|||||||
+8
-11
@@ -47,24 +47,22 @@ pytest -vv python/tests/docs
|
|||||||
|
|
||||||
### Checking typescript examples
|
### Checking typescript examples
|
||||||
|
|
||||||
The examples depend on `@lancedb/lancedb` at `file:../dist`, so the package must be
|
The `@lancedb/lancedb` package must be built before running the tests:
|
||||||
built before running the tests. This uses pnpm; see the
|
|
||||||
[Typescript contributing guide](../nodejs/CONTRIBUTING.md) for the toolchain setup.
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pushd nodejs
|
pushd nodejs
|
||||||
pnpm install
|
npm ci
|
||||||
pnpm build
|
npm run build
|
||||||
popd
|
popd
|
||||||
```
|
```
|
||||||
|
|
||||||
Then you can run the examples by going to the `nodejs/examples` directory, which is a
|
Then you can run the examples by going to the `nodejs/examples` directory and
|
||||||
separate pnpm package with its own lockfile:
|
running the tests like a normal npm package:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pushd nodejs/examples
|
pushd nodejs/examples
|
||||||
pnpm install
|
npm ci
|
||||||
pnpm test
|
npm test
|
||||||
popd
|
popd
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -86,7 +84,6 @@ The new files should be checked into the repository.
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
pushd nodejs
|
pushd nodejs
|
||||||
# `pnpm docs` would invoke pnpm's built-in `docs` command, not the script.
|
npm run docs
|
||||||
pnpm run docs
|
|
||||||
popd
|
popd
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -51,11 +51,6 @@ plugins:
|
|||||||
paths: [../python/python]
|
paths: [../python/python]
|
||||||
options:
|
options:
|
||||||
docstring_style: numpy
|
docstring_style: numpy
|
||||||
docstring_options:
|
|
||||||
# Attributes documented in a `Parameters` section, and pydantic
|
|
||||||
# dataclasses whose `__init__` griffe cannot see statically, both
|
|
||||||
# trip this check. It reports nothing actionable here.
|
|
||||||
warn_unknown_params: false
|
|
||||||
heading_level: 3
|
heading_level: 3
|
||||||
show_signature_annotations: true
|
show_signature_annotations: true
|
||||||
show_root_heading: true
|
show_root_heading: true
|
||||||
|
|||||||
+1
-11
@@ -453,16 +453,6 @@ paths:
|
|||||||
The metric type to use for the index. l2, Cosine, Dot are supported.
|
The metric type to use for the index. l2, Cosine, Dot are supported.
|
||||||
index_type:
|
index_type:
|
||||||
type: string
|
type: string
|
||||||
custom_stop_words:
|
|
||||||
type: [array, "null"]
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
description: |
|
|
||||||
The custom stop-word list for an FTS index. A non-null
|
|
||||||
array replaces the language's built-in stop-word list and is only
|
|
||||||
applied when remove_stop_words is enabled. Null uses the built-in
|
|
||||||
language list, while an empty array explicitly replaces it with no
|
|
||||||
stop words.
|
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: Index successfully created
|
description: Index successfully created
|
||||||
@@ -520,4 +510,4 @@ paths:
|
|||||||
"401":
|
"401":
|
||||||
$ref: "#/components/responses/unauthorized"
|
$ref: "#/components/responses/unauthorized"
|
||||||
"404":
|
"404":
|
||||||
$ref: "#/components/responses/not_found"
|
$ref: "#/components/responses/not_found"
|
||||||
Generated
+135
@@ -0,0 +1,135 @@
|
|||||||
|
{
|
||||||
|
"name": "lancedb-docs-test",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "lancedb-docs-test",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"license": "Apache 2",
|
||||||
|
"dependencies": {
|
||||||
|
"apache-arrow": "file:../node/node_modules/apache-arrow",
|
||||||
|
"vectordb": "file:../node"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^20.11.8",
|
||||||
|
"typescript": "^5.3.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"../node": {
|
||||||
|
"name": "vectordb",
|
||||||
|
"version": "0.21.2-beta.0",
|
||||||
|
"cpu": [
|
||||||
|
"x64",
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"os": [
|
||||||
|
"darwin",
|
||||||
|
"linux",
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"@neon-rs/load": "^0.0.74",
|
||||||
|
"axios": "^1.4.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@neon-rs/cli": "^0.0.160",
|
||||||
|
"@types/chai": "^4.3.4",
|
||||||
|
"@types/chai-as-promised": "^7.1.5",
|
||||||
|
"@types/mocha": "^10.0.1",
|
||||||
|
"@types/node": "^18.16.2",
|
||||||
|
"@types/sinon": "^10.0.15",
|
||||||
|
"@types/temp": "^0.9.1",
|
||||||
|
"@types/uuid": "^9.0.3",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^5.59.1",
|
||||||
|
"apache-arrow-old": "npm:apache-arrow@13.0.0",
|
||||||
|
"cargo-cp-artifact": "^0.1",
|
||||||
|
"chai": "^4.3.7",
|
||||||
|
"chai-as-promised": "^7.1.1",
|
||||||
|
"eslint": "^8.39.0",
|
||||||
|
"eslint-config-standard-with-typescript": "^34.0.1",
|
||||||
|
"eslint-plugin-import": "^2.26.0",
|
||||||
|
"eslint-plugin-n": "^15.7.0",
|
||||||
|
"eslint-plugin-promise": "^6.1.1",
|
||||||
|
"mocha": "^10.2.0",
|
||||||
|
"openai": "^4.24.1",
|
||||||
|
"sinon": "^15.1.0",
|
||||||
|
"temp": "^0.9.4",
|
||||||
|
"ts-node": "^10.9.1",
|
||||||
|
"ts-node-dev": "^2.0.0",
|
||||||
|
"typedoc": "^0.24.7",
|
||||||
|
"typedoc-plugin-markdown": "^3.15.3",
|
||||||
|
"typescript": "^5.1.0",
|
||||||
|
"uuid": "^9.0.0"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@lancedb/vectordb-darwin-arm64": "0.21.2-beta.0",
|
||||||
|
"@lancedb/vectordb-darwin-x64": "0.21.2-beta.0",
|
||||||
|
"@lancedb/vectordb-linux-arm64-gnu": "0.21.2-beta.0",
|
||||||
|
"@lancedb/vectordb-linux-x64-gnu": "0.21.2-beta.0",
|
||||||
|
"@lancedb/vectordb-win32-x64-msvc": "0.21.2-beta.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@apache-arrow/ts": "^14.0.2",
|
||||||
|
"apache-arrow": "^14.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"../node/node_modules/apache-arrow": {
|
||||||
|
"version": "14.0.2",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/command-line-args": "5.2.0",
|
||||||
|
"@types/command-line-usage": "5.0.2",
|
||||||
|
"@types/node": "20.3.0",
|
||||||
|
"@types/pad-left": "2.1.1",
|
||||||
|
"command-line-args": "5.2.1",
|
||||||
|
"command-line-usage": "7.0.1",
|
||||||
|
"flatbuffers": "23.5.26",
|
||||||
|
"json-bignum": "^0.0.3",
|
||||||
|
"pad-left": "^2.1.0",
|
||||||
|
"tslib": "^2.5.3"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"arrow2csv": "bin/arrow2csv.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/node": {
|
||||||
|
"version": "20.11.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.8.tgz",
|
||||||
|
"integrity": "sha512-i7omyekpPTNdv4Jb/Rgqg0RU8YqLcNsI12quKSDkRXNfx7Wxdm6HhK1awT3xTgEkgxPn3bvnSpiEAc7a7Lpyow==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"undici-types": "~5.26.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/apache-arrow": {
|
||||||
|
"resolved": "../node/node_modules/apache-arrow",
|
||||||
|
"link": true
|
||||||
|
},
|
||||||
|
"node_modules/typescript": {
|
||||||
|
"version": "5.3.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
|
||||||
|
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
|
||||||
|
"dev": true,
|
||||||
|
"bin": {
|
||||||
|
"tsc": "bin/tsc",
|
||||||
|
"tsserver": "bin/tsserver"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.17"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/undici-types": {
|
||||||
|
"version": "5.26.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
|
||||||
|
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"node_modules/vectordb": {
|
||||||
|
"resolved": "../node",
|
||||||
|
"link": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"name": "lancedb-docs-test",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "auto-generated tests from doc",
|
||||||
|
"author": "dev@lancedb.com",
|
||||||
|
"license": "Apache 2",
|
||||||
|
"dependencies": {
|
||||||
|
"apache-arrow": "file:../node/node_modules/apache-arrow",
|
||||||
|
"vectordb": "file:../node"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "tsc -b && cd ../node && npm run build-release",
|
||||||
|
"example": "npm run build && node",
|
||||||
|
"test": "npm run build && ls dist/*.js | xargs -n 1 node"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^20.11.8",
|
||||||
|
"typescript": "^5.3.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,5 +5,5 @@ mkdocs-autorefs>=0.5,<=1.0
|
|||||||
mkdocstrings[python]>=0.24,<1.0
|
mkdocstrings[python]>=0.24,<1.0
|
||||||
griffe>=0.40,<1.0
|
griffe>=0.40,<1.0
|
||||||
mkdocs-render-swagger-plugin>=0.1.0
|
mkdocs-render-swagger-plugin>=0.1.0
|
||||||
pydantic>=2.7.4,<3
|
pydantic>=2.0,<3.0
|
||||||
mkdocs-redirects>=1.2.0
|
mkdocs-redirects>=1.2.0
|
||||||
+30
-197
@@ -14,7 +14,7 @@ Add the following dependency to your `pom.xml`:
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.lancedb</groupId>
|
<groupId>com.lancedb</groupId>
|
||||||
<artifactId>lancedb-core</artifactId>
|
<artifactId>lancedb-core</artifactId>
|
||||||
<version>0.38.0-beta.13</version>
|
<version>0.30.0-beta.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -55,38 +55,6 @@ LanceNamespace namespaceClient = LanceDbNamespaceClientBuilder.newBuilder()
|
|||||||
| `region(String)` | AWS region (default: "us-east-1") | No |
|
| `region(String)` | AWS region (default: "us-east-1") | No |
|
||||||
| `config(String, String)` | Additional configuration parameters | No |
|
| `config(String, String)` | Additional configuration parameters | No |
|
||||||
|
|
||||||
### Opening a Table with Vended Credentials
|
|
||||||
|
|
||||||
When the catalog vends temporary object store credentials, open the table through the
|
|
||||||
namespace client. The Lance dataset builder fetches the table location and storage options
|
|
||||||
from the catalog and refreshes the credentials when they expire.
|
|
||||||
|
|
||||||
```java
|
|
||||||
import com.lancedb.LanceDbNamespaceClientBuilder;
|
|
||||||
import org.lance.Dataset;
|
|
||||||
import org.lance.namespace.LanceNamespace;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
LanceNamespace namespaceClient = LanceDbNamespaceClientBuilder.newBuilder()
|
|
||||||
.apiKey(System.getenv("LANCEDB_API_KEY"))
|
|
||||||
.database(System.getenv("LANCEDB_DATABASE"))
|
|
||||||
// Set the endpoint for a LanceDB Enterprise deployment.
|
|
||||||
// .endpoint("https://your-enterprise-endpoint")
|
|
||||||
.build();
|
|
||||||
|
|
||||||
try (Dataset dataset = Dataset.open()
|
|
||||||
.namespaceClient(namespaceClient)
|
|
||||||
.tableId(Arrays.asList("my_namespace", "my_table"))
|
|
||||||
.build()) {
|
|
||||||
System.out.println("Rows: " + dataset.countRows());
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Do not call `describeTable()` and then open the returned location with `Dataset.open(uri)`.
|
|
||||||
Opening through `namespaceClient()` is what applies the vended storage options and enables
|
|
||||||
automatic credential refresh. No object store credentials need to be passed by the application.
|
|
||||||
|
|
||||||
## Metadata Operations
|
## Metadata Operations
|
||||||
|
|
||||||
### Creating a Namespace Path
|
### Creating a Namespace Path
|
||||||
@@ -281,57 +249,6 @@ try (BufferAllocator allocator = new RootAllocator();
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Creating an Empty Table
|
|
||||||
|
|
||||||
To create an empty table, send an Arrow IPC stream that contains the table schema and no record batches.
|
|
||||||
The schema in the IPC stream becomes the table schema, and rows can be inserted later.
|
|
||||||
|
|
||||||
```java
|
|
||||||
import org.lance.namespace.model.CreateTableRequest;
|
|
||||||
import org.lance.namespace.model.CreateTableResponse;
|
|
||||||
import org.apache.arrow.memory.BufferAllocator;
|
|
||||||
import org.apache.arrow.memory.RootAllocator;
|
|
||||||
import org.apache.arrow.vector.VectorSchemaRoot;
|
|
||||||
import org.apache.arrow.vector.ipc.ArrowStreamWriter;
|
|
||||||
import org.apache.arrow.vector.types.FloatingPointPrecision;
|
|
||||||
import org.apache.arrow.vector.types.pojo.ArrowType;
|
|
||||||
import org.apache.arrow.vector.types.pojo.Field;
|
|
||||||
import org.apache.arrow.vector.types.pojo.FieldType;
|
|
||||||
import org.apache.arrow.vector.types.pojo.Schema;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.nio.channels.Channels;
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
Schema schema = new Schema(Arrays.asList(
|
|
||||||
new Field("id", FieldType.nullable(new ArrowType.Int(32, true)), null),
|
|
||||||
new Field("name", FieldType.nullable(new ArrowType.Utf8()), null),
|
|
||||||
new Field("embedding",
|
|
||||||
FieldType.nullable(new ArrowType.FixedSizeList(128)),
|
|
||||||
Arrays.asList(new Field("item",
|
|
||||||
FieldType.nullable(new ArrowType.FloatingPoint(FloatingPointPrecision.SINGLE)),
|
|
||||||
null)))
|
|
||||||
));
|
|
||||||
|
|
||||||
byte[] emptyTableData;
|
|
||||||
try (BufferAllocator allocator = new RootAllocator();
|
|
||||||
VectorSchemaRoot root = VectorSchemaRoot.create(schema, allocator)) {
|
|
||||||
root.setRowCount(0);
|
|
||||||
|
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
||||||
try (ArrowStreamWriter writer = new ArrowStreamWriter(root, null, Channels.newChannel(out))) {
|
|
||||||
writer.start();
|
|
||||||
writer.end();
|
|
||||||
}
|
|
||||||
emptyTableData = out.toByteArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
CreateTableRequest request = new CreateTableRequest();
|
|
||||||
request.setId(Arrays.asList("my_namespace", "empty_table"));
|
|
||||||
|
|
||||||
CreateTableResponse response = namespaceClient.createTable(request, emptyTableData);
|
|
||||||
```
|
|
||||||
|
|
||||||
### Insert
|
### Insert
|
||||||
|
|
||||||
```java
|
```java
|
||||||
@@ -514,88 +431,9 @@ query.setVector(vector);
|
|||||||
byte[] result = namespaceClient.queryTable(query);
|
byte[] result = namespaceClient.queryTable(query);
|
||||||
```
|
```
|
||||||
|
|
||||||
## Indexing
|
### Reading Query Results
|
||||||
|
|
||||||
The Java SDK exposes the REST namespace index operations through the same `LanceNamespace` client.
|
Query results are returned in Apache Arrow IPC file format. Here's how to read them:
|
||||||
Index creation runs asynchronously, so use `listTableIndices` or `describeTableIndexStats` to check progress.
|
|
||||||
|
|
||||||
### Creating a Vector Index
|
|
||||||
|
|
||||||
```java
|
|
||||||
import org.lance.namespace.model.CreateTableIndexRequest;
|
|
||||||
import org.lance.namespace.model.CreateTableIndexResponse;
|
|
||||||
|
|
||||||
CreateTableIndexRequest request = new CreateTableIndexRequest();
|
|
||||||
request.setId(Arrays.asList("my_namespace", "my_table"));
|
|
||||||
request.setColumn("embedding");
|
|
||||||
request.setIndexType("IVF_PQ");
|
|
||||||
request.setDistanceType("cosine");
|
|
||||||
request.setName("embedding_idx");
|
|
||||||
|
|
||||||
CreateTableIndexResponse response = namespaceClient.createTableIndex(request);
|
|
||||||
System.out.println("Index transaction: " + response.getTransactionId());
|
|
||||||
```
|
|
||||||
|
|
||||||
### Creating a Scalar Index
|
|
||||||
|
|
||||||
```java
|
|
||||||
import org.lance.namespace.model.CreateTableIndexRequest;
|
|
||||||
import org.lance.namespace.model.CreateTableScalarIndexResponse;
|
|
||||||
|
|
||||||
CreateTableIndexRequest request = new CreateTableIndexRequest();
|
|
||||||
request.setId(Arrays.asList("my_namespace", "my_table"));
|
|
||||||
request.setColumn("category");
|
|
||||||
request.setIndexType("BTREE");
|
|
||||||
request.setName("category_idx");
|
|
||||||
|
|
||||||
CreateTableScalarIndexResponse response = namespaceClient.createTableScalarIndex(request);
|
|
||||||
System.out.println("Index transaction: " + response.getTransactionId());
|
|
||||||
```
|
|
||||||
|
|
||||||
### Creating a Full Text Search Index
|
|
||||||
|
|
||||||
```java
|
|
||||||
import org.lance.namespace.model.CreateTableIndexRequest;
|
|
||||||
import org.lance.namespace.model.CreateTableScalarIndexResponse;
|
|
||||||
|
|
||||||
CreateTableIndexRequest request = new CreateTableIndexRequest();
|
|
||||||
request.setId(Arrays.asList("my_namespace", "my_table"));
|
|
||||||
request.setColumn("text_column");
|
|
||||||
request.setIndexType("FTS");
|
|
||||||
request.setName("text_idx");
|
|
||||||
request.setBaseTokenizer("simple");
|
|
||||||
request.setLowerCase(true);
|
|
||||||
request.setWithPosition(true);
|
|
||||||
|
|
||||||
CreateTableScalarIndexResponse response = namespaceClient.createTableScalarIndex(request);
|
|
||||||
System.out.println("Index transaction: " + response.getTransactionId());
|
|
||||||
```
|
|
||||||
|
|
||||||
### Listing Indexes
|
|
||||||
|
|
||||||
```java
|
|
||||||
import org.lance.namespace.model.IndexContent;
|
|
||||||
import org.lance.namespace.model.ListTableIndicesRequest;
|
|
||||||
import org.lance.namespace.model.ListTableIndicesResponse;
|
|
||||||
|
|
||||||
ListTableIndicesRequest request = new ListTableIndicesRequest();
|
|
||||||
request.setId(Arrays.asList("my_namespace", "my_table"));
|
|
||||||
|
|
||||||
ListTableIndicesResponse response = namespaceClient.listTableIndices(request);
|
|
||||||
for (IndexContent index : response.getIndexes()) {
|
|
||||||
System.out.println(index.getIndexName() + ": " + index.getStatus());
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
!!! note
|
|
||||||
The current Java namespace API exposes index type, index name, distance type, and full text search tokenizer options.
|
|
||||||
IVF training parameters such as `num_partitions` are not exposed by `CreateTableIndexRequest` yet.
|
|
||||||
To make those configurable from Java, the namespace API must add those fields first.
|
|
||||||
|
|
||||||
## Reading Query Results
|
|
||||||
|
|
||||||
Query results are returned as bytes in Apache Arrow IPC file format. Put the byte-channel
|
|
||||||
adapter behind a small helper so query code can work with `ArrowFileReader` directly:
|
|
||||||
|
|
||||||
```java
|
```java
|
||||||
import org.apache.arrow.vector.ipc.ArrowFileReader;
|
import org.apache.arrow.vector.ipc.ArrowFileReader;
|
||||||
@@ -603,50 +441,45 @@ import org.apache.arrow.vector.VectorSchemaRoot;
|
|||||||
import org.apache.arrow.memory.BufferAllocator;
|
import org.apache.arrow.memory.BufferAllocator;
|
||||||
import org.apache.arrow.memory.RootAllocator;
|
import org.apache.arrow.memory.RootAllocator;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.channels.SeekableByteChannel;
|
import java.nio.channels.SeekableByteChannel;
|
||||||
|
|
||||||
final class ArrowIpc {
|
// Helper class to read Arrow data from byte array
|
||||||
static ArrowFileReader openFileReader(byte[] data, BufferAllocator allocator) throws IOException {
|
class ByteArraySeekableByteChannel implements SeekableByteChannel {
|
||||||
return new ArrowFileReader(new ByteArraySeekableByteChannel(data), allocator);
|
private final byte[] data;
|
||||||
|
private long position = 0;
|
||||||
|
private boolean isOpen = true;
|
||||||
|
|
||||||
|
public ByteArraySeekableByteChannel(byte[] data) {
|
||||||
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final class ByteArraySeekableByteChannel implements SeekableByteChannel {
|
@Override
|
||||||
private final byte[] data;
|
public int read(ByteBuffer dst) {
|
||||||
private long position = 0;
|
int remaining = dst.remaining();
|
||||||
private boolean isOpen = true;
|
int available = (int) (data.length - position);
|
||||||
|
if (available <= 0) return -1;
|
||||||
private ByteArraySeekableByteChannel(byte[] data) {
|
int toRead = Math.min(remaining, available);
|
||||||
this.data = data;
|
dst.put(data, (int) position, toRead);
|
||||||
}
|
position += toRead;
|
||||||
|
return toRead;
|
||||||
@Override
|
|
||||||
public int read(ByteBuffer dst) {
|
|
||||||
int remaining = dst.remaining();
|
|
||||||
int available = (int) (data.length - position);
|
|
||||||
if (available <= 0) return -1;
|
|
||||||
int toRead = Math.min(remaining, available);
|
|
||||||
dst.put(data, (int) position, toRead);
|
|
||||||
position += toRead;
|
|
||||||
return toRead;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override public long position() { return position; }
|
|
||||||
@Override public SeekableByteChannel position(long newPosition) { position = newPosition; return this; }
|
|
||||||
@Override public long size() { return data.length; }
|
|
||||||
@Override public boolean isOpen() { return isOpen; }
|
|
||||||
@Override public void close() { isOpen = false; }
|
|
||||||
@Override public int write(ByteBuffer src) { throw new UnsupportedOperationException(); }
|
|
||||||
@Override public SeekableByteChannel truncate(long size) { throw new UnsupportedOperationException(); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public long position() { return position; }
|
||||||
|
@Override public SeekableByteChannel position(long newPosition) { position = newPosition; return this; }
|
||||||
|
@Override public long size() { return data.length; }
|
||||||
|
@Override public boolean isOpen() { return isOpen; }
|
||||||
|
@Override public void close() { isOpen = false; }
|
||||||
|
@Override public int write(ByteBuffer src) { throw new UnsupportedOperationException(); }
|
||||||
|
@Override public SeekableByteChannel truncate(long size) { throw new UnsupportedOperationException(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read query results
|
// Read query results
|
||||||
byte[] queryResult = namespaceClient.queryTable(query);
|
byte[] queryResult = namespaceClient.queryTable(query);
|
||||||
|
|
||||||
try (BufferAllocator allocator = new RootAllocator();
|
try (BufferAllocator allocator = new RootAllocator();
|
||||||
ArrowFileReader reader = ArrowIpc.openFileReader(queryResult, allocator)) {
|
ArrowFileReader reader = new ArrowFileReader(
|
||||||
|
new ByteArraySeekableByteChannel(queryResult), allocator)) {
|
||||||
|
|
||||||
for (int i = 0; i < reader.getRecordBlocks().size(); i++) {
|
for (int i = 0; i < reader.getRecordBlocks().size(); i++) {
|
||||||
reader.loadRecordBatch(reader.getRecordBlocks().get(i));
|
reader.loadRecordBatch(reader.getRecordBlocks().get(i));
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Contributing to LanceDB Typescript
|
# Contributing to LanceDB Typescript
|
||||||
|
|
||||||
This document outlines the process for contributing to LanceDB Typescript.
|
This document outlines the process for contributing to LanceDB Typescript.
|
||||||
For general contribution guidelines, see [CONTRIBUTING.md](https://github.com/lancedb/lancedb/blob/main/CONTRIBUTING.md).
|
For general contribution guidelines, see [CONTRIBUTING.md](../CONTRIBUTING.md).
|
||||||
|
|
||||||
## Project layout
|
## Project layout
|
||||||
|
|
||||||
|
|||||||
@@ -1,518 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / AutoQuery
|
|
||||||
|
|
||||||
# Class: AutoQuery
|
|
||||||
|
|
||||||
A builder for automatic string searches.
|
|
||||||
|
|
||||||
Automatic search determines whether to use full-text or vector search from
|
|
||||||
the table revision selected for each execution. This builder exposes the
|
|
||||||
common operations supported by both query families.
|
|
||||||
|
|
||||||
## Extends
|
|
||||||
|
|
||||||
- `StandardQueryBase`<`NativeQuery` \| `NativeVectorQuery`>
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### inner
|
|
||||||
|
|
||||||
```ts
|
|
||||||
protected inner: Query | VectorQuery | Promise<Query | VectorQuery>;
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.inner`
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### analyzePlan()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
analyzePlan(distributedMetrics?): Promise<string>
|
|
||||||
```
|
|
||||||
|
|
||||||
Executes the query and returns the physical query plan annotated with runtime metrics.
|
|
||||||
|
|
||||||
This is useful for debugging and performance analysis, as it shows how the query was executed
|
|
||||||
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **distributedMetrics?**: [`AnalyzePlanDistributedMetrics`](../type-aliases/AnalyzePlanDistributedMetrics.md)
|
|
||||||
How distributed worker metrics are displayed for remote query plans.
|
|
||||||
Defaults to `"aggregate"`.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`string`>
|
|
||||||
|
|
||||||
A query execution plan with runtime metrics for each step.
|
|
||||||
|
|
||||||
#### Example
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import * as lancedb from "@lancedb/lancedb"
|
|
||||||
|
|
||||||
const db = await lancedb.connect("./.lancedb");
|
|
||||||
const table = await db.createTable("my_table", [
|
|
||||||
{ vector: [1.1, 0.9], id: "1" },
|
|
||||||
]);
|
|
||||||
|
|
||||||
const plan = await table.query().nearestTo([0.5, 0.2]).analyzePlan();
|
|
||||||
|
|
||||||
Example output (with runtime metrics inlined):
|
|
||||||
AnalyzeExec verbose=true, metrics=[]
|
|
||||||
ProjectionExec: expr=[id@3 as id, vector@0 as vector, _distance@2 as _distance], metrics=[output_rows=1, elapsed_compute=3.292µs]
|
|
||||||
Take: columns="vector, _rowid, _distance, (id)", metrics=[output_rows=1, elapsed_compute=66.001µs, batches_processed=1, bytes_read=8, iops=1, requests=1]
|
|
||||||
CoalesceBatchesExec: target_batch_size=1024, metrics=[output_rows=1, elapsed_compute=3.333µs]
|
|
||||||
GlobalLimitExec: skip=0, fetch=10, metrics=[output_rows=1, elapsed_compute=167ns]
|
|
||||||
FilterExec: _distance@2 IS NOT NULL, metrics=[output_rows=1, elapsed_compute=8.542µs]
|
|
||||||
SortExec: TopK(fetch=10), expr=[_distance@2 ASC NULLS LAST], metrics=[output_rows=1, elapsed_compute=63.25µs, row_replacements=1]
|
|
||||||
KNNVectorDistance: metric=l2, metrics=[output_rows=1, elapsed_compute=114.333µs, output_batches=1]
|
|
||||||
LanceScan: uri=/path/to/data, projection=[vector], row_id=true, row_addr=false, ordered=false, metrics=[output_rows=1, elapsed_compute=103.626µs, bytes_read=549, iops=2, requests=2]
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.analyzePlan`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### execute()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
protected execute(options?): AsyncGenerator<RecordBatch<any>, void, unknown>
|
|
||||||
```
|
|
||||||
|
|
||||||
Execute the query and return the results as an
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **options?**: `Partial`<[`QueryExecutionOptions`](../interfaces/QueryExecutionOptions.md)>
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`AsyncGenerator`<`RecordBatch`<`any`>, `void`, `unknown`>
|
|
||||||
|
|
||||||
#### See
|
|
||||||
|
|
||||||
- AsyncIterator
|
|
||||||
of
|
|
||||||
- RecordBatch.
|
|
||||||
|
|
||||||
By default, LanceDb will use many threads to calculate results and, when
|
|
||||||
the result set is large, multiple batches will be processed at one time.
|
|
||||||
This readahead is limited however and backpressure will be applied if this
|
|
||||||
stream is consumed slowly (this constrains the maximum memory used by a
|
|
||||||
single query)
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.execute`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### explainPlan()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
explainPlan(verbose): Promise<string>
|
|
||||||
```
|
|
||||||
|
|
||||||
Generates an explanation of the query execution plan.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **verbose**: `boolean` = `false`
|
|
||||||
If true, provides a more detailed explanation. Defaults to false.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`string`>
|
|
||||||
|
|
||||||
A Promise that resolves to a string containing the query execution plan explanation.
|
|
||||||
|
|
||||||
#### Example
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import * as lancedb from "@lancedb/lancedb"
|
|
||||||
const db = await lancedb.connect("./.lancedb");
|
|
||||||
const table = await db.createTable("my_table", [
|
|
||||||
{ vector: [1.1, 0.9], id: "1" },
|
|
||||||
]);
|
|
||||||
const plan = await table.query().nearestTo([0.5, 0.2]).explainPlan();
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.explainPlan`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### fastSearch()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
fastSearch(): this
|
|
||||||
```
|
|
||||||
|
|
||||||
Skip searching un-indexed data. This can make search faster, but will miss
|
|
||||||
any data that is not yet indexed.
|
|
||||||
|
|
||||||
Use [Table#optimize](Table.md#optimize) to index all un-indexed data.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.fastSearch`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### ~~filter()~~
|
|
||||||
|
|
||||||
```ts
|
|
||||||
filter(predicate): this
|
|
||||||
```
|
|
||||||
|
|
||||||
A filter statement to be applied to this query.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **predicate**: `string`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
#### See
|
|
||||||
|
|
||||||
where
|
|
||||||
|
|
||||||
#### Deprecated
|
|
||||||
|
|
||||||
Use `where` instead
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.filter`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### fullTextSearch()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
fullTextSearch(query, options?): this
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **query**: `string` \| [`FullTextQuery`](../interfaces/FullTextQuery.md)
|
|
||||||
|
|
||||||
* **options?**: `Partial`<[`FullTextSearchOptions`](../interfaces/FullTextSearchOptions.md)>
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.fullTextSearch`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### limit()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
limit(limit): this
|
|
||||||
```
|
|
||||||
|
|
||||||
Set the maximum number of results to return.
|
|
||||||
|
|
||||||
By default, a plain search has no limit. If this method is not
|
|
||||||
called then every valid row from the table will be returned.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **limit**: `number`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.limit`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### offset()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
offset(offset): this
|
|
||||||
```
|
|
||||||
|
|
||||||
Set the number of rows to skip before returning results.
|
|
||||||
|
|
||||||
This is useful for pagination.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **offset**: `number`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.offset`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### orderBy()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
orderBy(ordering): this
|
|
||||||
```
|
|
||||||
|
|
||||||
Sort the results by the specified column(s).
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **ordering**: [`ColumnOrdering`](../interfaces/ColumnOrdering.md) \| [`ColumnOrdering`](../interfaces/ColumnOrdering.md)[]
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
This query builder.
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.orderBy`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### outputSchema()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
outputSchema(): Promise<Schema<any>>
|
|
||||||
```
|
|
||||||
|
|
||||||
Returns the schema of the output that will be returned by this query.
|
|
||||||
|
|
||||||
This can be used to inspect the types and names of the columns that will be
|
|
||||||
returned by the query before executing it.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`Schema`<`any`>>
|
|
||||||
|
|
||||||
An Arrow Schema describing the output columns.
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.outputSchema`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### select()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
select(columns): this
|
|
||||||
```
|
|
||||||
|
|
||||||
Return only the specified columns.
|
|
||||||
|
|
||||||
By default a query will return all columns from the table. However, this can have
|
|
||||||
a very significant impact on latency. LanceDb stores data in a columnar fashion. This
|
|
||||||
means we can finely tune our I/O to select exactly the columns we need.
|
|
||||||
|
|
||||||
As a best practice you should always limit queries to the columns that you need. If you
|
|
||||||
pass in an array of column names then only those columns will be returned.
|
|
||||||
|
|
||||||
You can also use this method to create new "dynamic" columns based on your existing columns.
|
|
||||||
For example, you may not care about "a" or "b" but instead simply want "a + b". This is often
|
|
||||||
seen in the SELECT clause of an SQL query (e.g. `SELECT a+b FROM my_table`).
|
|
||||||
|
|
||||||
To create dynamic columns you can pass in a Map<string, string>. A column will be returned
|
|
||||||
for each entry in the map. The key provides the name of the column. The value is
|
|
||||||
an SQL string used to specify how the column is calculated.
|
|
||||||
|
|
||||||
For example, an SQL query might state `SELECT a + b AS combined, c`. The equivalent
|
|
||||||
input to this method would be:
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **columns**: `string` \| `string`[] \| `Record`<`string`, `string`> \| `Map`<`string`, `string`>
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
#### Example
|
|
||||||
|
|
||||||
```ts
|
|
||||||
new Map([["combined", "a + b"], ["c", "c"]])
|
|
||||||
|
|
||||||
Columns will always be returned in the order given, even if that order is different than
|
|
||||||
the order used when adding the data.
|
|
||||||
|
|
||||||
Note that you can pass in a `Record<string, string>` (e.g. an object literal). This method
|
|
||||||
uses `Object.entries` which should preserve the insertion order of the object. However,
|
|
||||||
object insertion order is easy to get wrong and `Map` is more foolproof.
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.select`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### toArray()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
toArray(options?): Promise<any[]>
|
|
||||||
```
|
|
||||||
|
|
||||||
Collect the results as an array of objects.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **options?**: `Partial`<[`QueryExecutionOptions`](../interfaces/QueryExecutionOptions.md)>
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`any`[]>
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.toArray`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### toArrow()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
toArrow(options?): Promise<Table<any>>
|
|
||||||
```
|
|
||||||
|
|
||||||
Collect the results as an Arrow
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **options?**: `Partial`<[`QueryExecutionOptions`](../interfaces/QueryExecutionOptions.md)>
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`Table`<`any`>>
|
|
||||||
|
|
||||||
#### See
|
|
||||||
|
|
||||||
ArrowTable.
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.toArrow`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### useLsm()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
useLsm(enable): this
|
|
||||||
```
|
|
||||||
|
|
||||||
Control MemWAL read routing for this query.
|
|
||||||
|
|
||||||
By default (unset), when the table carries a MemWAL write spec (see
|
|
||||||
[Table#setLsmWriteSpec](Table.md#setlsmwritespec)), reads are routed through the LSM scanner so
|
|
||||||
they also return data written via the `mergeInsert` LSM path that has not yet
|
|
||||||
been compacted into the base table (the active/frozen in-memory memtables and
|
|
||||||
the flushed generations), deduplicated by primary key; a table without a spec
|
|
||||||
reads the base table.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **enable**: `boolean`
|
|
||||||
`true` forces the LSM scanner and errors if the table has no
|
|
||||||
MemWAL write spec. `false` bypasses the MemWAL and reads the base table only,
|
|
||||||
even when a spec is present.
|
|
||||||
Note: the LSM scanner does not support every query shape (e.g. reranking,
|
|
||||||
hybrid search, `orderBy`). On a MemWAL table those shapes error unless
|
|
||||||
`useLsm(false)` is set, because a base-only read would silently exclude
|
|
||||||
un-compacted MemWAL data.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.useLsm`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### where()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
where(predicate): this
|
|
||||||
```
|
|
||||||
|
|
||||||
A filter statement to be applied to this query.
|
|
||||||
|
|
||||||
The filter should be supplied as an SQL query string. For example:
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **predicate**: `string`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
#### Example
|
|
||||||
|
|
||||||
```ts
|
|
||||||
x > 10
|
|
||||||
y > 0 AND y < 100
|
|
||||||
x > 5 OR y = 'test'
|
|
||||||
|
|
||||||
Filtering performance can often be improved by creating a scalar index
|
|
||||||
on the filter column(s).
|
|
||||||
|
|
||||||
Calling this multiple times combines the filters with a logical AND rather
|
|
||||||
than replacing the previous filter.
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.where`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### withRowId()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
withRowId(): this
|
|
||||||
```
|
|
||||||
|
|
||||||
Whether to return the row id in the results.
|
|
||||||
|
|
||||||
This column can be used to match results between different queries. For
|
|
||||||
example, to match results from a full text search and a vector search in
|
|
||||||
order to perform hybrid search.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.withRowId`
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / BranchContents
|
|
||||||
|
|
||||||
# Class: BranchContents
|
|
||||||
|
|
||||||
## Constructors
|
|
||||||
|
|
||||||
### new BranchContents()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
new BranchContents(): BranchContents
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
[`BranchContents`](BranchContents.md)
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### manifestSize
|
|
||||||
|
|
||||||
```ts
|
|
||||||
manifestSize: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### parentBranch?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional parentBranch: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### parentVersion
|
|
||||||
|
|
||||||
```ts
|
|
||||||
parentVersion: number;
|
|
||||||
```
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / Branches
|
|
||||||
|
|
||||||
# Class: Branches
|
|
||||||
|
|
||||||
Branch manager for a [Table](Table.md).
|
|
||||||
|
|
||||||
Unlike tags, `create` and `checkout` return a new [Table](Table.md) handle scoped
|
|
||||||
to the branch; writes on it do not affect `main`.
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### checkout()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
checkout(name, version?): Promise<Table>
|
|
||||||
```
|
|
||||||
|
|
||||||
Check out an existing branch and return a handle scoped to it.
|
|
||||||
|
|
||||||
With `version` set, the returned handle is pinned to that version of the
|
|
||||||
branch (a read-only, detached view); otherwise it tracks the branch's
|
|
||||||
latest and stays writable.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **name**: `string`
|
|
||||||
|
|
||||||
* **version?**: `number`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Table`](Table.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### cherryPick()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
cherryPick(fromBranch, dryRun): Promise<CherryPickResult>
|
|
||||||
```
|
|
||||||
|
|
||||||
Cherry-pick a branch onto main.
|
|
||||||
|
|
||||||
Set `dryRun` to `true` to preview. A failed cherry-pick resolves
|
|
||||||
with `status: "failed"` instead of throwing.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **fromBranch**: `string`
|
|
||||||
Branch to cherry-pick from.
|
|
||||||
|
|
||||||
* **dryRun**: `boolean` = `false`
|
|
||||||
When true, only preview. Defaults to false.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`CherryPickResult`](../interfaces/CherryPickResult.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### create()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
create(
|
|
||||||
name,
|
|
||||||
fromRef?,
|
|
||||||
fromVersion?): Promise<Table>
|
|
||||||
```
|
|
||||||
|
|
||||||
Create a branch and return a handle scoped to it.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **name**: `string`
|
|
||||||
Name of the new branch.
|
|
||||||
|
|
||||||
* **fromRef?**: `string`
|
|
||||||
Source branch to fork from. Defaults to `main`.
|
|
||||||
|
|
||||||
* **fromVersion?**: `number`
|
|
||||||
A specific version on `fromRef`. Defaults to latest.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Table`](Table.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### delete()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
delete(name): Promise<void>
|
|
||||||
```
|
|
||||||
|
|
||||||
Delete a branch.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **name**: `string`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`void`>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### diff()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
diff(fromBranch): Promise<BranchDiff>
|
|
||||||
```
|
|
||||||
|
|
||||||
Compare a branch against main without modifying either branch.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **fromBranch**: `string`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`BranchDiff`](../interfaces/BranchDiff.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### list()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
list(): Promise<Record<string, BranchContents>>
|
|
||||||
```
|
|
||||||
|
|
||||||
List all branches, mapping name to branch metadata.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`Record`<`string`, [`BranchContents`](BranchContents.md)>>
|
|
||||||
@@ -25,27 +25,6 @@ the underlying connection has been closed.
|
|||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
### cancelJob()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract cancelJob(jobId): Promise<boolean>
|
|
||||||
```
|
|
||||||
|
|
||||||
Request cancellation of a server-side job by id.
|
|
||||||
|
|
||||||
Resolves to true if the server accepted the cancellation, false if no
|
|
||||||
such job exists. Cancelling an already-terminal job is a no-op success.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **jobId**: `string`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`boolean`>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### cloneTable()
|
### cloneTable()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -169,45 +148,6 @@ Creates a new empty Table
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### createMaterializedView()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract createMaterializedView(
|
|
||||||
name,
|
|
||||||
source,
|
|
||||||
options?): Promise<MaterializedView>
|
|
||||||
```
|
|
||||||
|
|
||||||
Define a materialized view named `name` over the table `source`.
|
|
||||||
|
|
||||||
The view is created empty, with the query recorded in its schema
|
|
||||||
metadata; `view.refresh()` computes the rows. The view is a normal
|
|
||||||
table: it can be queried, indexed and searched, and it appears in
|
|
||||||
`tableNames`. The source table must have stable row ids (create it with
|
|
||||||
the `newTableEnableStableRowIds` storage option); they keep the view's
|
|
||||||
provenance valid across source compactions and cannot be enabled after
|
|
||||||
a table exists. Local databases only.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **name**: `string`
|
|
||||||
|
|
||||||
* **source**: `string`
|
|
||||||
|
|
||||||
* **options?**
|
|
||||||
|
|
||||||
* **options.limit?**: `number`
|
|
||||||
|
|
||||||
* **options.select?**: [`MaterializedViewSelect`](../type-aliases/MaterializedViewSelect.md)
|
|
||||||
|
|
||||||
* **options.where?**: `string`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`MaterializedView`](MaterializedView.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### createNamespace()
|
### createNamespace()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -425,49 +365,6 @@ Drop an existing table.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### dropTableAsync()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract dropTableAsync(name, namespacePath?): Promise<Job>
|
|
||||||
```
|
|
||||||
|
|
||||||
Start dropping a table and return its cleanup job.
|
|
||||||
|
|
||||||
The table may become unavailable before its data files are removed. Wait
|
|
||||||
on the returned job to know when cleanup has finished.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **name**: `string`
|
|
||||||
|
|
||||||
* **namespacePath?**: `string`[]
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Job`](Job.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### getJob()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract getJob(jobId): Promise<null | JobDescription>
|
|
||||||
```
|
|
||||||
|
|
||||||
Describe a single server-side job by id.
|
|
||||||
|
|
||||||
Resolves to `null` when the server has no such job.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **jobId**: `string`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`null` \| [`JobDescription`](../interfaces/JobDescription.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### isOpen()
|
### isOpen()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -482,78 +379,6 @@ Return true if the connection has not been closed
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### job()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract job(jobId): Job
|
|
||||||
```
|
|
||||||
|
|
||||||
A [Job](Job.md) handle for a server-side job by id.
|
|
||||||
|
|
||||||
The handle is constructed without a server round trip; an unknown id
|
|
||||||
surfaces when the handle is used. Dropping the handle has no effect on
|
|
||||||
the job itself.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **jobId**: `string`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
[`Job`](Job.md)
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### jobHistory()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract jobHistory(jobId?): Promise<Table<any>>
|
|
||||||
```
|
|
||||||
|
|
||||||
The lifecycle event history of a server-side job, as an Arrow table.
|
|
||||||
|
|
||||||
Lists history across all jobs when `jobId` is omitted.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **jobId?**: `string`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`Table`<`any`>>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### listJobs()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract listJobs(): Promise<JobInfo[]>
|
|
||||||
```
|
|
||||||
|
|
||||||
List server-side jobs across the database's tables.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`JobInfo`](../interfaces/JobInfo.md)[]>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### listMaterializedViews()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract listMaterializedViews(): Promise<string[]>
|
|
||||||
```
|
|
||||||
|
|
||||||
The names of the materialized views in this database.
|
|
||||||
|
|
||||||
Found by reading every table's schema, so this costs an open per table.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`string`[]>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### listNamespaces()
|
### listNamespaces()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -584,90 +409,6 @@ Child namespace names and
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### listTables()
|
|
||||||
|
|
||||||
#### listTables(options)
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract listTables(options?): Promise<ListTablesResponse>
|
|
||||||
```
|
|
||||||
|
|
||||||
List a page of the tables in this database.
|
|
||||||
|
|
||||||
To retrieve the tables after the page, pass the `pageToken` the response
|
|
||||||
carries back in. A page can be shorter than `limit` without being the last
|
|
||||||
one, so walk until a response carries no page token:
|
|
||||||
|
|
||||||
```ts
|
|
||||||
const names = [];
|
|
||||||
let pageToken = undefined;
|
|
||||||
do {
|
|
||||||
const page = await conn.listTables({ pageToken, limit: 100 });
|
|
||||||
names.push(...page.tables);
|
|
||||||
pageToken = page.pageToken;
|
|
||||||
} while (pageToken);
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Parameters
|
|
||||||
|
|
||||||
* **options?**: `Partial`<[`ListTablesOptions`](../interfaces/ListTablesOptions.md)>
|
|
||||||
Pagination options
|
|
||||||
(`pageToken`, `limit`).
|
|
||||||
|
|
||||||
##### Returns
|
|
||||||
|
|
||||||
`Promise`<[`ListTablesResponse`](../interfaces/ListTablesResponse.md)>
|
|
||||||
|
|
||||||
A page of table names and an
|
|
||||||
optional token for the tables after it.
|
|
||||||
|
|
||||||
#### listTables(namespacePath, options)
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract listTables(namespacePath?, options?): Promise<ListTablesResponse>
|
|
||||||
```
|
|
||||||
|
|
||||||
List a page of the tables in this database.
|
|
||||||
|
|
||||||
##### Parameters
|
|
||||||
|
|
||||||
* **namespacePath?**: `string`[]
|
|
||||||
The namespace path to list tables from
|
|
||||||
(defaults to root namespace)
|
|
||||||
|
|
||||||
* **options?**: `Partial`<[`ListTablesOptions`](../interfaces/ListTablesOptions.md)>
|
|
||||||
Pagination options
|
|
||||||
(`pageToken`, `limit`).
|
|
||||||
|
|
||||||
##### Returns
|
|
||||||
|
|
||||||
`Promise`<[`ListTablesResponse`](../interfaces/ListTablesResponse.md)>
|
|
||||||
|
|
||||||
A page of table names and an
|
|
||||||
optional token for the tables after it.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### openMaterializedView()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract openMaterializedView(name): Promise<MaterializedView>
|
|
||||||
```
|
|
||||||
|
|
||||||
Open the materialized view named `name`.
|
|
||||||
|
|
||||||
Rejects a table that exists but is not a materialized view.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **name**: `string`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`MaterializedView`](MaterializedView.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### openTable()
|
### openTable()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -677,13 +418,18 @@ abstract openTable(
|
|||||||
options?): Promise<Table>
|
options?): Promise<Table>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Open a table in the database.
|
||||||
|
|
||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
* **name**: `string`
|
* **name**: `string`
|
||||||
|
The name of the table
|
||||||
|
|
||||||
* **namespacePath?**: `string`[]
|
* **namespacePath?**: `string`[]
|
||||||
|
The namespace path of the table (defaults to root namespace)
|
||||||
|
|
||||||
* **options?**: `Partial`<[`OpenTableOptions`](../interfaces/OpenTableOptions.md)>
|
* **options?**: `Partial`<[`OpenTableOptions`](../interfaces/OpenTableOptions.md)>
|
||||||
|
Additional options
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@@ -724,7 +470,7 @@ a "not supported" error.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### ~~tableNames()~~
|
### tableNames()
|
||||||
|
|
||||||
#### tableNames(options)
|
#### tableNames(options)
|
||||||
|
|
||||||
@@ -746,10 +492,6 @@ Tables will be returned in lexicographical order.
|
|||||||
|
|
||||||
`Promise`<`string`[]>
|
`Promise`<`string`[]>
|
||||||
|
|
||||||
##### Deprecated
|
|
||||||
|
|
||||||
Use [Connection.listTables](Connection.md#listtables) instead.
|
|
||||||
|
|
||||||
#### tableNames(namespacePath, options)
|
#### tableNames(namespacePath, options)
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -772,7 +514,3 @@ Tables will be returned in lexicographical order.
|
|||||||
##### Returns
|
##### Returns
|
||||||
|
|
||||||
`Promise`<`string`[]>
|
`Promise`<`string`[]>
|
||||||
|
|
||||||
##### Deprecated
|
|
||||||
|
|
||||||
Use [Connection.listTables](Connection.md#listtables) instead.
|
|
||||||
|
|||||||
@@ -57,24 +57,6 @@ block size may be added in the future.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### fm()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
static fm(): Index
|
|
||||||
```
|
|
||||||
|
|
||||||
Create an FM-Index.
|
|
||||||
|
|
||||||
An FM-Index is a scalar index on string or binary columns that accelerates
|
|
||||||
substring search, i.e. `contains(col, 'needle')`. Unlike the tokenized
|
|
||||||
full-text-search index, it matches arbitrary substrings of the raw bytes.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
[`Index`](Index.md)
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### fts()
|
### fts()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|||||||
@@ -1,83 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / Job
|
|
||||||
|
|
||||||
# Class: Job
|
|
||||||
|
|
||||||
A handle to an operation that may still be running.
|
|
||||||
|
|
||||||
## Constructors
|
|
||||||
|
|
||||||
### new Job()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
new Job(): Job
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
[`Job`](Job.md)
|
|
||||||
|
|
||||||
## Accessors
|
|
||||||
|
|
||||||
### id
|
|
||||||
|
|
||||||
```ts
|
|
||||||
get id(): null | string
|
|
||||||
```
|
|
||||||
|
|
||||||
Identifies the operation on the server that is running it. Operations
|
|
||||||
that run in this process have no server id. The value is opaque.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`null` \| `string`
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### cancel()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
cancel(): Promise<void>
|
|
||||||
```
|
|
||||||
|
|
||||||
Request cancellation. Cancelling a finished operation is a no-op.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`void`>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### status()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
status(): Promise<string>
|
|
||||||
```
|
|
||||||
|
|
||||||
The operation's current lifecycle state: "running", "finished",
|
|
||||||
"failed", or "cancelled".
|
|
||||||
|
|
||||||
A point snapshot; unlike [Job.wait](Job.md#wait) it does not block or reject
|
|
||||||
on a terminal failure state. States a newer server reports that this
|
|
||||||
client version does not know pass through as-is.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`string`>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### wait()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
wait(): Promise<void>
|
|
||||||
```
|
|
||||||
|
|
||||||
Wait until the operation reaches a terminal state.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`void`>
|
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / MaterializedView
|
|
||||||
|
|
||||||
# Class: MaterializedView
|
|
||||||
|
|
||||||
A handle on a materialized view: its table plus its definition.
|
|
||||||
|
|
||||||
Obtained from [Connection#createMaterializedView](Connection.md#creatematerializedview) or
|
|
||||||
[Connection#openMaterializedView](Connection.md#openmaterializedview). The view is a normal table --
|
|
||||||
queries, indexes and search all apply through [MaterializedView#table](MaterializedView.md#table)
|
|
||||||
-- whose contents are maintained by [MaterializedView#refresh](MaterializedView.md#refresh).
|
|
||||||
|
|
||||||
## Constructors
|
|
||||||
|
|
||||||
### new MaterializedView()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
new MaterializedView(table): MaterializedView
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **table**: [`Table`](Table.md)
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
[`MaterializedView`](MaterializedView.md)
|
|
||||||
|
|
||||||
## Accessors
|
|
||||||
|
|
||||||
### name
|
|
||||||
|
|
||||||
```ts
|
|
||||||
get name(): string
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### definition()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
definition(): Promise<MaterializedViewDefinition>
|
|
||||||
```
|
|
||||||
|
|
||||||
The query that defines the view, read from its stored schema.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`MaterializedViewDefinition`](../interfaces/MaterializedViewDefinition.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### refresh()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
refresh(options?): Promise<RefreshMaterializedViewResult>
|
|
||||||
```
|
|
||||||
|
|
||||||
Recompute the view from its source.
|
|
||||||
|
|
||||||
The refresh is incremental when the source's changes can be reconciled
|
|
||||||
into the view -- rows added, changed or removed since the last one --
|
|
||||||
and otherwise rebuilds. `full` forces a rebuild; `sourceVersion`
|
|
||||||
refreshes to that source version instead of the latest.
|
|
||||||
|
|
||||||
Concurrent refreshes of one view do not duplicate its rows. Two that
|
|
||||||
plan the same source rows conflict on commit, and the loser throws
|
|
||||||
rather than writing them a second time.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **options?**
|
|
||||||
|
|
||||||
* **options.full?**: `boolean`
|
|
||||||
|
|
||||||
* **options.sourceVersion?**: `number`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`RefreshMaterializedViewResult`](../interfaces/RefreshMaterializedViewResult.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### table()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
table(): Table
|
|
||||||
```
|
|
||||||
|
|
||||||
The view, as the table it is.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
[`Table`](Table.md)
|
|
||||||
@@ -76,56 +76,6 @@ the query optimizer chooses a suboptimal path.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### useLsm()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
useLsm(enable): MergeInsertBuilder
|
|
||||||
```
|
|
||||||
|
|
||||||
Control MemWAL routing for this merge.
|
|
||||||
|
|
||||||
By default (unset), a `mergeInsert` on a table with an LSM write spec is
|
|
||||||
routed through Lance's MemWAL shard writer, and a table without one uses the
|
|
||||||
standard path.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **enable**: `boolean`
|
|
||||||
`true` forces MemWAL routing and errors if the table has no
|
|
||||||
LSM write spec. `false` forces the standard write path even when a spec is set.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
[`MergeInsertBuilder`](MergeInsertBuilder.md)
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### validateSingleShard()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
validateSingleShard(validateSingleShard): MergeInsertBuilder
|
|
||||||
```
|
|
||||||
|
|
||||||
Controls how an LSM merge checks that its input targets a single shard.
|
|
||||||
|
|
||||||
When a table has an LSM write spec, every row in a `mergeInsert` call must
|
|
||||||
route to the same shard. When `true` (the default), every row is inspected
|
|
||||||
to verify this. When `false`, only the first row is inspected and the
|
|
||||||
shard it routes to is used for the whole input — a faster path for callers
|
|
||||||
that have already pre-sharded their input. Has no effect on tables without
|
|
||||||
an LSM write spec.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **validateSingleShard**: `boolean`
|
|
||||||
Whether to check every row routes to one shard. Defaults to `true`.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
[`MergeInsertBuilder`](MergeInsertBuilder.md)
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### whenMatchedUpdateAll()
|
### whenMatchedUpdateAll()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ protected inner: Query | Promise<Query>;
|
|||||||
### analyzePlan()
|
### analyzePlan()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
analyzePlan(distributedMetrics?): Promise<string>
|
analyzePlan(): Promise<string>
|
||||||
```
|
```
|
||||||
|
|
||||||
Executes the query and returns the physical query plan annotated with runtime metrics.
|
Executes the query and returns the physical query plan annotated with runtime metrics.
|
||||||
@@ -41,12 +41,6 @@ Executes the query and returns the physical query plan annotated with runtime me
|
|||||||
This is useful for debugging and performance analysis, as it shows how the query was executed
|
This is useful for debugging and performance analysis, as it shows how the query was executed
|
||||||
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **distributedMetrics?**: [`AnalyzePlanDistributedMetrics`](../type-aliases/AnalyzePlanDistributedMetrics.md)
|
|
||||||
How distributed worker metrics are displayed for remote query plans.
|
|
||||||
Defaults to `"aggregate"`.
|
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
`Promise`<`string`>
|
`Promise`<`string`>
|
||||||
@@ -497,42 +491,6 @@ ArrowTable.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### useLsm()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
useLsm(enable): this
|
|
||||||
```
|
|
||||||
|
|
||||||
Control MemWAL read routing for this query.
|
|
||||||
|
|
||||||
By default (unset), when the table carries a MemWAL write spec (see
|
|
||||||
[Table#setLsmWriteSpec](Table.md#setlsmwritespec)), reads are routed through the LSM scanner so
|
|
||||||
they also return data written via the `mergeInsert` LSM path that has not yet
|
|
||||||
been compacted into the base table (the active/frozen in-memory memtables and
|
|
||||||
the flushed generations), deduplicated by primary key; a table without a spec
|
|
||||||
reads the base table.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **enable**: `boolean`
|
|
||||||
`true` forces the LSM scanner and errors if the table has no
|
|
||||||
MemWAL write spec. `false` bypasses the MemWAL and reads the base table only,
|
|
||||||
even when a spec is present.
|
|
||||||
Note: the LSM scanner does not support every query shape (e.g. reranking,
|
|
||||||
hybrid search, `orderBy`). On a MemWAL table those shapes error unless
|
|
||||||
`useLsm(false)` is set, because a base-only read would silently exclude
|
|
||||||
un-compacted MemWAL data.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.useLsm`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### where()
|
### where()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -560,9 +518,6 @@ x > 5 OR y = 'test'
|
|||||||
|
|
||||||
Filtering performance can often be improved by creating a scalar index
|
Filtering performance can often be improved by creating a scalar index
|
||||||
on the filter column(s).
|
on the filter column(s).
|
||||||
|
|
||||||
Calling this multiple times combines the filters with a logical AND rather
|
|
||||||
than replacing the previous filter.
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Inherited from
|
#### Inherited from
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ protected inner: NativeQueryType | Promise<NativeQueryType>;
|
|||||||
### analyzePlan()
|
### analyzePlan()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
analyzePlan(distributedMetrics?): Promise<string>
|
analyzePlan(): Promise<string>
|
||||||
```
|
```
|
||||||
|
|
||||||
Executes the query and returns the physical query plan annotated with runtime metrics.
|
Executes the query and returns the physical query plan annotated with runtime metrics.
|
||||||
@@ -46,12 +46,6 @@ Executes the query and returns the physical query plan annotated with runtime me
|
|||||||
This is useful for debugging and performance analysis, as it shows how the query was executed
|
This is useful for debugging and performance analysis, as it shows how the query was executed
|
||||||
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **distributedMetrics?**: [`AnalyzePlanDistributedMetrics`](../type-aliases/AnalyzePlanDistributedMetrics.md)
|
|
||||||
How distributed worker metrics are displayed for remote query plans.
|
|
||||||
Defaults to `"aggregate"`.
|
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
`Promise`<`string`>
|
`Promise`<`string`>
|
||||||
|
|||||||
@@ -69,34 +69,14 @@ abstract addColumns(newColumnTransforms): Promise<AddColumnsResult>
|
|||||||
|
|
||||||
Add new columns with defined values.
|
Add new columns with defined values.
|
||||||
|
|
||||||
The `{ computed }` form stores the expression rather than evaluating it
|
|
||||||
now: the column is committed with no values, and rows get them from
|
|
||||||
[Table#refreshColumn](Table.md#refreshcolumn). Declaring one therefore costs the same on a
|
|
||||||
large table as on an empty one.
|
|
||||||
|
|
||||||
A refresh does not revisit rows it has already filled, so mutating an
|
|
||||||
input leaves the value computed at fill time; recomputing means dropping
|
|
||||||
the column and declaring it again. While a declaration reads a column,
|
|
||||||
that column cannot be renamed, retyped or dropped.
|
|
||||||
|
|
||||||
On LanceDB Cloud and Enterprise the expression is planned by the
|
|
||||||
server, and the refresh runs as a server job -- see
|
|
||||||
[Table#refreshColumnAsync](Table.md#refreshcolumnasync).
|
|
||||||
|
|
||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
* **newColumnTransforms**:
|
* **newColumnTransforms**: `Field`<`any`> \| `Field`<`any`>[] \| `Schema`<`any`> \| [`AddColumnsSql`](../interfaces/AddColumnsSql.md)[]
|
||||||
\| `Field`<`any`>
|
|
||||||
\| `Field`<`any`>[]
|
|
||||||
\| `Schema`<`any`>
|
|
||||||
\| [`AddColumnsSql`](../interfaces/AddColumnsSql.md)[]
|
|
||||||
\| `object`
|
|
||||||
Either:
|
Either:
|
||||||
- An array of objects with column names and SQL expressions to calculate values
|
- An array of objects with column names and SQL expressions to calculate values
|
||||||
- A single Arrow Field defining one column with its data type (column will be initialized with null values)
|
- A single Arrow Field defining one column with its data type (column will be initialized with null values)
|
||||||
- An array of Arrow Fields defining columns with their data types (columns will be initialized with null values)
|
- An array of Arrow Fields defining columns with their data types (columns will be initialized with null values)
|
||||||
- An Arrow Schema defining columns with their data types (columns will be initialized with null values)
|
- An Arrow Schema defining columns with their data types (columns will be initialized with null values)
|
||||||
- `{ computed }`, declaring columns defined by a SQL expression whose type and inputs are derived from it
|
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@@ -105,13 +85,6 @@ server, and the refresh runs as a server job -- see
|
|||||||
A promise that resolves to an object
|
A promise that resolves to an object
|
||||||
containing the new version number of the table after adding the columns.
|
containing the new version number of the table after adding the columns.
|
||||||
|
|
||||||
#### Example
|
|
||||||
|
|
||||||
```ts
|
|
||||||
await table.addColumns({ computed: [{ name: "doubled", valueSql: "x * 2" }] });
|
|
||||||
const { rowsFilled } = await table.refreshColumn("doubled");
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### alterColumns()
|
### alterColumns()
|
||||||
@@ -137,23 +110,6 @@ containing the new version number of the table after altering the columns.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### branches()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract branches(): Promise<Branches>
|
|
||||||
```
|
|
||||||
|
|
||||||
Get the branch manager for this table.
|
|
||||||
|
|
||||||
Branches are isolated, writable lines of history forked from another
|
|
||||||
branch (or version). Writes on a branch do not affect `main`.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Branches`](Branches.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### checkout()
|
### checkout()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -213,39 +169,6 @@ version of the table.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### checkpointLsm()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract checkpointLsm(): Promise<void>
|
|
||||||
```
|
|
||||||
|
|
||||||
Converge this table's LSM write path into its base table.
|
|
||||||
|
|
||||||
Seals once, then triggers compaction and polls until the L0 that existed
|
|
||||||
at the start is gone. The target set is fixed at the start, so
|
|
||||||
generations created *during* the checkpoint are ignored — that is what
|
|
||||||
lets it terminate under write load, and what makes it best-effort: it
|
|
||||||
converges the fresh tier as of some instant. Idempotent, abandonable at
|
|
||||||
any point, and safe to run on a cadence.
|
|
||||||
|
|
||||||
There is no liveness bound — the compactor pool is shared across tables,
|
|
||||||
so a checkpoint queued behind unrelated work looks exactly like one that
|
|
||||||
is merging. The caller owns the deadline.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`void`>
|
|
||||||
|
|
||||||
#### Example
|
|
||||||
|
|
||||||
```ts
|
|
||||||
const before = await table.getLsmStats();
|
|
||||||
await table.checkpointLsm();
|
|
||||||
const after = await table.getLsmStats();
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### close()
|
### close()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -264,43 +187,6 @@ Any attempt to use the table after it is closed will result in an error.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### closeLsmWriters()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract closeLsmWriters(): Promise<void>
|
|
||||||
```
|
|
||||||
|
|
||||||
Drain and close any cached MemWAL shard writers held for this table.
|
|
||||||
|
|
||||||
When an [LsmWriteSpec](../interfaces/LsmWriteSpec.md) is installed, `mergeInsert` opens MemWAL
|
|
||||||
shard writers and caches them for reuse across calls. This closes them,
|
|
||||||
flushing pending data; writers reopen lazily on the next `mergeInsert`.
|
|
||||||
It is a no-op when no writers are cached.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`void`>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### compactLsm()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract compactLsm(): Promise<void>
|
|
||||||
```
|
|
||||||
|
|
||||||
Trigger a background L0 → base compaction pass per bucket.
|
|
||||||
|
|
||||||
Returns once the passes are *dispatched*, not once they finish — watch
|
|
||||||
[Table#getLsmStats](Table.md#getlsmstats) for progress, or use
|
|
||||||
[Table#checkpointLsm](Table.md#checkpointlsm) to wait for convergence.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`void`>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### countRows()
|
### countRows()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -373,46 +259,6 @@ await table.createIndex("my_float_col");
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### createIndexAsync()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract createIndexAsync(column, options?): Promise<Job>
|
|
||||||
```
|
|
||||||
|
|
||||||
Create an index, returning a handle to the indexing job.
|
|
||||||
|
|
||||||
The job may already be complete when returned; callers must not assume
|
|
||||||
the index exists until [Job.wait](Job.md#wait) resolves.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **column**: `string`
|
|
||||||
|
|
||||||
* **options?**: `Partial`<[`IndexOptions`](../interfaces/IndexOptions.md)>
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Job`](Job.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### currentBranch()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract currentBranch(): null | string
|
|
||||||
```
|
|
||||||
|
|
||||||
The branch this table handle is scoped to, or `null` for the main branch.
|
|
||||||
|
|
||||||
A handle returned by [Branches.create](Branches.md#create) or [Branches.checkout](Branches.md#checkout)
|
|
||||||
reports the branch it targets; a handle opened normally reports `null`.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`null` \| `string`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### delete()
|
### delete()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -499,69 +345,6 @@ Drop an index from the table.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### flushLsm()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract flushLsm(): Promise<void>
|
|
||||||
```
|
|
||||||
|
|
||||||
Seal every bucket's active memtable into a new L0 generation.
|
|
||||||
|
|
||||||
Returns once the seal is committed. Sealing an empty memtable is a no-op,
|
|
||||||
so this is safe to call repeatedly.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`void`>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### getLsmStats()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract getLsmStats(includeGenerationRows?): Promise<undefined | LsmStats>
|
|
||||||
```
|
|
||||||
|
|
||||||
Read live per-bucket LSM state.
|
|
||||||
|
|
||||||
Answers "how far behind is my fresh tier", "which bucket is hot", and
|
|
||||||
"why is my fresh-tier vector search brute-force". Mutates no table state.
|
|
||||||
|
|
||||||
Resolves to `undefined` only when the LSM write path is not enabled.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **includeGenerationRows?**: `boolean`
|
|
||||||
Also count rows per L0 generation.
|
|
||||||
Off by default because each count opens an uncached Lance dataset.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`undefined` \| [`LsmStats`](../interfaces/LsmStats.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### getLsmWriteSpec()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract getLsmWriteSpec(): Promise<undefined | LsmWriteSpec>
|
|
||||||
```
|
|
||||||
|
|
||||||
Read the [LsmWriteSpec](../interfaces/LsmWriteSpec.md) currently installed on this table.
|
|
||||||
|
|
||||||
Resolves to `undefined` when the MemWAL LSM write path is not enabled (no
|
|
||||||
spec has been set, or it was removed with [Table#unsetLsmWriteSpec](Table.md#unsetlsmwritespec)).
|
|
||||||
The returned spec mirrors what was passed to
|
|
||||||
[Table#setLsmWriteSpec](Table.md#setlsmwritespec), except that `maintainedIndexes` always
|
|
||||||
reports the concrete list resolved when the spec was set — `undefined`
|
|
||||||
never round-trips.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`undefined` \| [`LsmWriteSpec`](../interfaces/LsmWriteSpec.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### indexStats()
|
### indexStats()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -838,67 +621,6 @@ for await (const batch of table.query()) {
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### refreshColumn()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract refreshColumn(column): Promise<RefreshColumnResult>
|
|
||||||
```
|
|
||||||
|
|
||||||
Fill the rows of a computed column that hold no value yet.
|
|
||||||
|
|
||||||
Rows appended since the last refresh are filled by the next one; rows
|
|
||||||
already filled are left as they are, so the call is idempotent and does
|
|
||||||
not observe a mutated input. Local tables only: a remote refresh runs
|
|
||||||
as a server job, through [Table#refreshColumnAsync](Table.md#refreshcolumnasync).
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **column**: `string`
|
|
||||||
The name of the computed column to fill.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`RefreshColumnResult`](../interfaces/RefreshColumnResult.md)>
|
|
||||||
|
|
||||||
A promise that resolves to the
|
|
||||||
number of rows filled and the new version number of the table.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### refreshColumnAsync()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract refreshColumnAsync(column): Promise<Job>
|
|
||||||
```
|
|
||||||
|
|
||||||
Like [Table#refreshColumn](Table.md#refreshcolumn), but returns a handle to the refresh
|
|
||||||
job instead of blocking until it completes.
|
|
||||||
|
|
||||||
The job may already be complete when returned; callers must not assume
|
|
||||||
the column is filled until [Job.wait](Job.md#wait) resolves. Invalid input --
|
|
||||||
an unknown column, or one that is not computed -- rejects here rather
|
|
||||||
than failing the job. On local tables the job runs in-process; on
|
|
||||||
LanceDB Cloud and Enterprise it is the server's backfill job.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **column**: `string`
|
|
||||||
The name of the computed column to fill.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Job`](Job.md)>
|
|
||||||
|
|
||||||
#### Example
|
|
||||||
|
|
||||||
```ts
|
|
||||||
const job = await table.refreshColumnAsync("doubled");
|
|
||||||
await job.wait();
|
|
||||||
console.log(await job.status()); // "finished"
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### restore()
|
### restore()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -942,7 +664,7 @@ Get the schema of the table.
|
|||||||
abstract search(
|
abstract search(
|
||||||
query,
|
query,
|
||||||
queryType?,
|
queryType?,
|
||||||
ftsColumns?): Query | VectorQuery | AutoQuery
|
ftsColumns?): Query | VectorQuery
|
||||||
```
|
```
|
||||||
|
|
||||||
Create a search query to find the nearest neighbors
|
Create a search query to find the nearest neighbors
|
||||||
@@ -964,7 +686,7 @@ of the given query
|
|||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
[`Query`](Query.md) \| [`VectorQuery`](VectorQuery.md) \| [`AutoQuery`](AutoQuery.md)
|
[`Query`](Query.md) \| [`VectorQuery`](VectorQuery.md)
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
@@ -988,11 +710,6 @@ All variants require the table to have an unenforced primary key
|
|||||||
([Table#setUnenforcedPrimaryKey](Table.md#setunenforcedprimarykey)); bucket sharding additionally
|
([Table#setUnenforcedPrimaryKey](Table.md#setunenforcedprimarykey)); bucket sharding additionally
|
||||||
requires it to be the single column being bucketed.
|
requires it to be the single column being bucketed.
|
||||||
|
|
||||||
Omitting `maintainedIndexes` maintains every index on the table, resolved
|
|
||||||
here, failing if one cannot be maintained — name them to install anyway.
|
|
||||||
Naming them pins an exact set, and a still-building index is rejected
|
|
||||||
rather than quietly omitted.
|
|
||||||
|
|
||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
* **spec**: [`LsmWriteSpec`](../interfaces/LsmWriteSpec.md)
|
* **spec**: [`LsmWriteSpec`](../interfaces/LsmWriteSpec.md)
|
||||||
@@ -1144,32 +861,6 @@ Return the table as an arrow table
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### tokenize()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract tokenize(query, options): Promise<FtsToken[]>
|
|
||||||
```
|
|
||||||
|
|
||||||
Tokenize a full-text search query using the tokenizer configured on an FTS index.
|
|
||||||
|
|
||||||
Specify exactly one of `column` or `indexName`.
|
|
||||||
|
|
||||||
Model-backed tokenizers such as `jieba/*` and `lindera/*` are rebuilt in
|
|
||||||
the client process from index metadata. For remote tables, this means the
|
|
||||||
same tokenizer model files must also exist locally.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **query**: `string`
|
|
||||||
|
|
||||||
* **options**: [`TokenizeTableOptions`](../type-aliases/TokenizeTableOptions.md)
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`FtsToken`](../interfaces/FtsToken.md)[]>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### unsetLsmWriteSpec()
|
### unsetLsmWriteSpec()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -1284,41 +975,6 @@ based on the row being updated (e.g. "my_col + 1")
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### updateFieldMetadata()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract updateFieldMetadata(updates): Promise<UpdateFieldMetadataResult>
|
|
||||||
```
|
|
||||||
|
|
||||||
Update per-field (column) metadata.
|
|
||||||
|
|
||||||
The following keys are treated specially, by convention, and should be
|
|
||||||
used when appropriate:
|
|
||||||
|
|
||||||
- `lancedb:description`: for a human-readable description of a field.
|
|
||||||
- `lancedb:tag:<name>`: for a user-defined key-value tag, where the suffix
|
|
||||||
names the tag category; e.g. `lancedb:tag:model: "clip"`.
|
|
||||||
- `lancedb:logical-column`: for a column grouping; e.g. `feature_v1` and
|
|
||||||
`feature_v2` might be in the same logical column.
|
|
||||||
- `lancedb:status`: for status options (`production`, `candidate`,
|
|
||||||
`deprecated`, `archived`) to designate the current life cycle state of
|
|
||||||
this column.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **updates**: [`FieldMetadataUpdate`](../interfaces/FieldMetadataUpdate.md)[]
|
|
||||||
One or more per-field updates. Each
|
|
||||||
update's metadata is merged into the field's existing metadata by default;
|
|
||||||
a value of `null` deletes that key, and `replace: true` swaps the whole map.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`UpdateFieldMetadataResult`](../interfaces/UpdateFieldMetadataResult.md)>
|
|
||||||
|
|
||||||
resolves to the new table version.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### vectorSearch()
|
### vectorSearch()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ protected inner: TakeQuery | Promise<TakeQuery>;
|
|||||||
### analyzePlan()
|
### analyzePlan()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
analyzePlan(distributedMetrics?): Promise<string>
|
analyzePlan(): Promise<string>
|
||||||
```
|
```
|
||||||
|
|
||||||
Executes the query and returns the physical query plan annotated with runtime metrics.
|
Executes the query and returns the physical query plan annotated with runtime metrics.
|
||||||
@@ -37,12 +37,6 @@ Executes the query and returns the physical query plan annotated with runtime me
|
|||||||
This is useful for debugging and performance analysis, as it shows how the query was executed
|
This is useful for debugging and performance analysis, as it shows how the query was executed
|
||||||
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **distributedMetrics?**: [`AnalyzePlanDistributedMetrics`](../type-aliases/AnalyzePlanDistributedMetrics.md)
|
|
||||||
How distributed worker metrics are displayed for remote query plans.
|
|
||||||
Defaults to `"aggregate"`.
|
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
`Promise`<`string`>
|
`Promise`<`string`>
|
||||||
@@ -273,29 +267,6 @@ ArrowTable.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### useLsm()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
useLsm(enable): this
|
|
||||||
```
|
|
||||||
|
|
||||||
Control MemWAL read routing for this take query.
|
|
||||||
|
|
||||||
`false` bypasses the MemWAL and reads the base table only — the escape hatch,
|
|
||||||
since take-by-row-id/offset is not supported on the LSM scanner and, on a
|
|
||||||
MemWAL table, auto-routes to it and errors otherwise.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **enable**: `boolean`
|
|
||||||
`false` reads the base table only.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### withRowId()
|
### withRowId()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ addQueryVector(vector): VectorQuery
|
|||||||
### analyzePlan()
|
### analyzePlan()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
analyzePlan(distributedMetrics?): Promise<string>
|
analyzePlan(): Promise<string>
|
||||||
```
|
```
|
||||||
|
|
||||||
Executes the query and returns the physical query plan annotated with runtime metrics.
|
Executes the query and returns the physical query plan annotated with runtime metrics.
|
||||||
@@ -59,12 +59,6 @@ Executes the query and returns the physical query plan annotated with runtime me
|
|||||||
This is useful for debugging and performance analysis, as it shows how the query was executed
|
This is useful for debugging and performance analysis, as it shows how the query was executed
|
||||||
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **distributedMetrics?**: [`AnalyzePlanDistributedMetrics`](../type-aliases/AnalyzePlanDistributedMetrics.md)
|
|
||||||
How distributed worker metrics are displayed for remote query plans.
|
|
||||||
Defaults to `"aggregate"`.
|
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
`Promise`<`string`>
|
`Promise`<`string`>
|
||||||
@@ -746,42 +740,6 @@ ArrowTable.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### useLsm()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
useLsm(enable): this
|
|
||||||
```
|
|
||||||
|
|
||||||
Control MemWAL read routing for this query.
|
|
||||||
|
|
||||||
By default (unset), when the table carries a MemWAL write spec (see
|
|
||||||
[Table#setLsmWriteSpec](Table.md#setlsmwritespec)), reads are routed through the LSM scanner so
|
|
||||||
they also return data written via the `mergeInsert` LSM path that has not yet
|
|
||||||
been compacted into the base table (the active/frozen in-memory memtables and
|
|
||||||
the flushed generations), deduplicated by primary key; a table without a spec
|
|
||||||
reads the base table.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **enable**: `boolean`
|
|
||||||
`true` forces the LSM scanner and errors if the table has no
|
|
||||||
MemWAL write spec. `false` bypasses the MemWAL and reads the base table only,
|
|
||||||
even when a spec is present.
|
|
||||||
Note: the LSM scanner does not support every query shape (e.g. reranking,
|
|
||||||
hybrid search, `orderBy`). On a MemWAL table those shapes error unless
|
|
||||||
`useLsm(false)` is set, because a base-only read would silently exclude
|
|
||||||
un-compacted MemWAL data.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.useLsm`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### where()
|
### where()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -809,9 +767,6 @@ x > 5 OR y = 'test'
|
|||||||
|
|
||||||
Filtering performance can often be improved by creating a scalar index
|
Filtering performance can often be improved by creating a scalar index
|
||||||
on the filter column(s).
|
on the filter column(s).
|
||||||
|
|
||||||
Calling this multiple times combines the filters with a logical AND rather
|
|
||||||
than replacing the previous filter.
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Inherited from
|
#### Inherited from
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / OAuthFlowType
|
|
||||||
|
|
||||||
# Enumeration: OAuthFlowType
|
|
||||||
|
|
||||||
OAuth authentication flow types.
|
|
||||||
|
|
||||||
## Enumeration Members
|
|
||||||
|
|
||||||
### AzureManagedIdentity
|
|
||||||
|
|
||||||
```ts
|
|
||||||
AzureManagedIdentity: "azure_managed_identity";
|
|
||||||
```
|
|
||||||
|
|
||||||
Azure Managed Identity via IMDS.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### ClientCredentials
|
|
||||||
|
|
||||||
```ts
|
|
||||||
ClientCredentials: "client_credentials";
|
|
||||||
```
|
|
||||||
|
|
||||||
Client Credentials grant (service-to-service / M2M).
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / instrumentLanceDbMetrics
|
|
||||||
|
|
||||||
# Function: instrumentLanceDbMetrics()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
function instrumentLanceDbMetrics(meterProvider?): boolean
|
|
||||||
```
|
|
||||||
|
|
||||||
Register LanceDB metrics as OpenTelemetry observable instruments.
|
|
||||||
|
|
||||||
Installs a process-global metrics recorder and creates one observable
|
|
||||||
instrument per LanceDB metric (currently object store request counts, bytes,
|
|
||||||
latency, errors, and throttles) on the given (or global) `MeterProvider`. The
|
|
||||||
configured `MetricReader` then collects them on its own schedule.
|
|
||||||
|
|
||||||
Counters and gauges map directly to observable counters/gauges. Because
|
|
||||||
OpenTelemetry has no asynchronous histogram instrument, each histogram is
|
|
||||||
exported Prometheus-style as cumulative `le` bucket counts (`<name>_bucket`,
|
|
||||||
with an `le` attribute) plus `<name>_count` and `<name>_sum`.
|
|
||||||
|
|
||||||
Requires `@opentelemetry/api` (a dependency) and, to actually export, an
|
|
||||||
OpenTelemetry SDK such as `@opentelemetry/sdk-metrics`.
|
|
||||||
|
|
||||||
## Parameters
|
|
||||||
|
|
||||||
* **meterProvider?**: `MeterProvider`
|
|
||||||
The provider to register instruments on. Defaults to the
|
|
||||||
global provider from `@opentelemetry/api`.
|
|
||||||
|
|
||||||
## Returns
|
|
||||||
|
|
||||||
`boolean`
|
|
||||||
|
|
||||||
`true` if the recorder is installed and instruments are registered.
|
|
||||||
`false` if a different `metrics` recorder is already installed in this
|
|
||||||
process (only one global recorder is permitted), in which case a warning is
|
|
||||||
emitted and no instruments are created. Calling this more than once is safe;
|
|
||||||
instruments are created only on the first successful call.
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / tokenize
|
|
||||||
|
|
||||||
# Function: tokenize()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
function tokenize(query, options?): Promise<FtsToken[]>
|
|
||||||
```
|
|
||||||
|
|
||||||
Tokenize a full-text search query using an explicit tokenizer.
|
|
||||||
|
|
||||||
This does not require a table or FTS index. The tokenizer options match
|
|
||||||
[Index.fts](../classes/Index.md#fts).
|
|
||||||
|
|
||||||
## Parameters
|
|
||||||
|
|
||||||
* **query**: `string`
|
|
||||||
|
|
||||||
* **options?**: `Partial`<[`TokenizeOptions`](../interfaces/TokenizeOptions.md)>
|
|
||||||
|
|
||||||
## Returns
|
|
||||||
|
|
||||||
`Promise`<[`FtsToken`](../interfaces/FtsToken.md)[]>
|
|
||||||
@@ -12,24 +12,18 @@
|
|||||||
## Enumerations
|
## Enumerations
|
||||||
|
|
||||||
- [FullTextQueryType](enumerations/FullTextQueryType.md)
|
- [FullTextQueryType](enumerations/FullTextQueryType.md)
|
||||||
- [OAuthFlowType](enumerations/OAuthFlowType.md)
|
|
||||||
- [Occur](enumerations/Occur.md)
|
- [Occur](enumerations/Occur.md)
|
||||||
- [Operator](enumerations/Operator.md)
|
- [Operator](enumerations/Operator.md)
|
||||||
|
|
||||||
## Classes
|
## Classes
|
||||||
|
|
||||||
- [AutoQuery](classes/AutoQuery.md)
|
|
||||||
- [BooleanQuery](classes/BooleanQuery.md)
|
- [BooleanQuery](classes/BooleanQuery.md)
|
||||||
- [BoostQuery](classes/BoostQuery.md)
|
- [BoostQuery](classes/BoostQuery.md)
|
||||||
- [BranchContents](classes/BranchContents.md)
|
|
||||||
- [Branches](classes/Branches.md)
|
|
||||||
- [Connection](classes/Connection.md)
|
- [Connection](classes/Connection.md)
|
||||||
- [HeaderProvider](classes/HeaderProvider.md)
|
- [HeaderProvider](classes/HeaderProvider.md)
|
||||||
- [Index](classes/Index.md)
|
- [Index](classes/Index.md)
|
||||||
- [Job](classes/Job.md)
|
|
||||||
- [MakeArrowTableOptions](classes/MakeArrowTableOptions.md)
|
- [MakeArrowTableOptions](classes/MakeArrowTableOptions.md)
|
||||||
- [MatchQuery](classes/MatchQuery.md)
|
- [MatchQuery](classes/MatchQuery.md)
|
||||||
- [MaterializedView](classes/MaterializedView.md)
|
|
||||||
- [MergeInsertBuilder](classes/MergeInsertBuilder.md)
|
- [MergeInsertBuilder](classes/MergeInsertBuilder.md)
|
||||||
- [MultiMatchQuery](classes/MultiMatchQuery.md)
|
- [MultiMatchQuery](classes/MultiMatchQuery.md)
|
||||||
- [NativeJsHeaderProvider](classes/NativeJsHeaderProvider.md)
|
- [NativeJsHeaderProvider](classes/NativeJsHeaderProvider.md)
|
||||||
@@ -55,15 +49,6 @@
|
|||||||
- [AddDataOptions](interfaces/AddDataOptions.md)
|
- [AddDataOptions](interfaces/AddDataOptions.md)
|
||||||
- [AddResult](interfaces/AddResult.md)
|
- [AddResult](interfaces/AddResult.md)
|
||||||
- [AlterColumnsResult](interfaces/AlterColumnsResult.md)
|
- [AlterColumnsResult](interfaces/AlterColumnsResult.md)
|
||||||
- [BranchColumnChange](interfaces/BranchColumnChange.md)
|
|
||||||
- [BranchColumnSummary](interfaces/BranchColumnSummary.md)
|
|
||||||
- [BranchDiff](interfaces/BranchDiff.md)
|
|
||||||
- [BranchIndexSummary](interfaces/BranchIndexSummary.md)
|
|
||||||
- [BranchRowCountSummary](interfaces/BranchRowCountSummary.md)
|
|
||||||
- [BucketStats](interfaces/BucketStats.md)
|
|
||||||
- [CherryPickError](interfaces/CherryPickError.md)
|
|
||||||
- [CherryPickPreview](interfaces/CherryPickPreview.md)
|
|
||||||
- [CherryPickResult](interfaces/CherryPickResult.md)
|
|
||||||
- [ClientConfig](interfaces/ClientConfig.md)
|
- [ClientConfig](interfaces/ClientConfig.md)
|
||||||
- [ColumnAlteration](interfaces/ColumnAlteration.md)
|
- [ColumnAlteration](interfaces/ColumnAlteration.md)
|
||||||
- [ColumnOrdering](interfaces/ColumnOrdering.md)
|
- [ColumnOrdering](interfaces/ColumnOrdering.md)
|
||||||
@@ -80,14 +65,11 @@
|
|||||||
- [DropNamespaceOptions](interfaces/DropNamespaceOptions.md)
|
- [DropNamespaceOptions](interfaces/DropNamespaceOptions.md)
|
||||||
- [DropNamespaceResponse](interfaces/DropNamespaceResponse.md)
|
- [DropNamespaceResponse](interfaces/DropNamespaceResponse.md)
|
||||||
- [ExecutableQuery](interfaces/ExecutableQuery.md)
|
- [ExecutableQuery](interfaces/ExecutableQuery.md)
|
||||||
- [FieldMetadataUpdate](interfaces/FieldMetadataUpdate.md)
|
|
||||||
- [FragmentStatistics](interfaces/FragmentStatistics.md)
|
- [FragmentStatistics](interfaces/FragmentStatistics.md)
|
||||||
- [FragmentSummaryStats](interfaces/FragmentSummaryStats.md)
|
- [FragmentSummaryStats](interfaces/FragmentSummaryStats.md)
|
||||||
- [FtsOptions](interfaces/FtsOptions.md)
|
- [FtsOptions](interfaces/FtsOptions.md)
|
||||||
- [FtsToken](interfaces/FtsToken.md)
|
|
||||||
- [FullTextQuery](interfaces/FullTextQuery.md)
|
- [FullTextQuery](interfaces/FullTextQuery.md)
|
||||||
- [FullTextSearchOptions](interfaces/FullTextSearchOptions.md)
|
- [FullTextSearchOptions](interfaces/FullTextSearchOptions.md)
|
||||||
- [GenerationStats](interfaces/GenerationStats.md)
|
|
||||||
- [HnswPqOptions](interfaces/HnswPqOptions.md)
|
- [HnswPqOptions](interfaces/HnswPqOptions.md)
|
||||||
- [HnswSqOptions](interfaces/HnswSqOptions.md)
|
- [HnswSqOptions](interfaces/HnswSqOptions.md)
|
||||||
- [IndexConfig](interfaces/IndexConfig.md)
|
- [IndexConfig](interfaces/IndexConfig.md)
|
||||||
@@ -96,26 +78,14 @@
|
|||||||
- [IvfFlatOptions](interfaces/IvfFlatOptions.md)
|
- [IvfFlatOptions](interfaces/IvfFlatOptions.md)
|
||||||
- [IvfPqOptions](interfaces/IvfPqOptions.md)
|
- [IvfPqOptions](interfaces/IvfPqOptions.md)
|
||||||
- [IvfRqOptions](interfaces/IvfRqOptions.md)
|
- [IvfRqOptions](interfaces/IvfRqOptions.md)
|
||||||
- [JobDescription](interfaces/JobDescription.md)
|
|
||||||
- [JobFailureInfo](interfaces/JobFailureInfo.md)
|
|
||||||
- [JobInfo](interfaces/JobInfo.md)
|
|
||||||
- [ListNamespacesOptions](interfaces/ListNamespacesOptions.md)
|
- [ListNamespacesOptions](interfaces/ListNamespacesOptions.md)
|
||||||
- [ListNamespacesResponse](interfaces/ListNamespacesResponse.md)
|
- [ListNamespacesResponse](interfaces/ListNamespacesResponse.md)
|
||||||
- [ListTablesOptions](interfaces/ListTablesOptions.md)
|
|
||||||
- [ListTablesResponse](interfaces/ListTablesResponse.md)
|
|
||||||
- [LsmStats](interfaces/LsmStats.md)
|
|
||||||
- [LsmWriteSpec](interfaces/LsmWriteSpec.md)
|
- [LsmWriteSpec](interfaces/LsmWriteSpec.md)
|
||||||
- [MaterializedViewDefinition](interfaces/MaterializedViewDefinition.md)
|
|
||||||
- [MemtableStats](interfaces/MemtableStats.md)
|
|
||||||
- [MergeResult](interfaces/MergeResult.md)
|
- [MergeResult](interfaces/MergeResult.md)
|
||||||
- [NativeOAuthConfig](interfaces/NativeOAuthConfig.md)
|
|
||||||
- [OAuthConfig](interfaces/OAuthConfig.md)
|
|
||||||
- [OpenTableOptions](interfaces/OpenTableOptions.md)
|
- [OpenTableOptions](interfaces/OpenTableOptions.md)
|
||||||
- [OptimizeOptions](interfaces/OptimizeOptions.md)
|
- [OptimizeOptions](interfaces/OptimizeOptions.md)
|
||||||
- [OptimizeStats](interfaces/OptimizeStats.md)
|
- [OptimizeStats](interfaces/OptimizeStats.md)
|
||||||
- [QueryExecutionOptions](interfaces/QueryExecutionOptions.md)
|
- [QueryExecutionOptions](interfaces/QueryExecutionOptions.md)
|
||||||
- [RefreshColumnResult](interfaces/RefreshColumnResult.md)
|
|
||||||
- [RefreshMaterializedViewResult](interfaces/RefreshMaterializedViewResult.md)
|
|
||||||
- [RemovalStats](interfaces/RemovalStats.md)
|
- [RemovalStats](interfaces/RemovalStats.md)
|
||||||
- [RenameTableOptions](interfaces/RenameTableOptions.md)
|
- [RenameTableOptions](interfaces/RenameTableOptions.md)
|
||||||
- [RestNamespaceConfig](interfaces/RestNamespaceConfig.md)
|
- [RestNamespaceConfig](interfaces/RestNamespaceConfig.md)
|
||||||
@@ -131,8 +101,6 @@
|
|||||||
- [TimeoutConfig](interfaces/TimeoutConfig.md)
|
- [TimeoutConfig](interfaces/TimeoutConfig.md)
|
||||||
- [TlsConfig](interfaces/TlsConfig.md)
|
- [TlsConfig](interfaces/TlsConfig.md)
|
||||||
- [TokenResponse](interfaces/TokenResponse.md)
|
- [TokenResponse](interfaces/TokenResponse.md)
|
||||||
- [TokenizeOptions](interfaces/TokenizeOptions.md)
|
|
||||||
- [UpdateFieldMetadataResult](interfaces/UpdateFieldMetadataResult.md)
|
|
||||||
- [UpdateOptions](interfaces/UpdateOptions.md)
|
- [UpdateOptions](interfaces/UpdateOptions.md)
|
||||||
- [UpdateResult](interfaces/UpdateResult.md)
|
- [UpdateResult](interfaces/UpdateResult.md)
|
||||||
- [Version](interfaces/Version.md)
|
- [Version](interfaces/Version.md)
|
||||||
@@ -141,27 +109,21 @@
|
|||||||
|
|
||||||
## Type Aliases
|
## Type Aliases
|
||||||
|
|
||||||
- [AnalyzePlanDistributedMetrics](type-aliases/AnalyzePlanDistributedMetrics.md)
|
|
||||||
- [BaseTokenizer](type-aliases/BaseTokenizer.md)
|
|
||||||
- [Data](type-aliases/Data.md)
|
- [Data](type-aliases/Data.md)
|
||||||
- [DataLike](type-aliases/DataLike.md)
|
- [DataLike](type-aliases/DataLike.md)
|
||||||
- [FieldLike](type-aliases/FieldLike.md)
|
- [FieldLike](type-aliases/FieldLike.md)
|
||||||
- [IntoSql](type-aliases/IntoSql.md)
|
- [IntoSql](type-aliases/IntoSql.md)
|
||||||
- [IntoVector](type-aliases/IntoVector.md)
|
- [IntoVector](type-aliases/IntoVector.md)
|
||||||
- [MaterializedViewSelect](type-aliases/MaterializedViewSelect.md)
|
|
||||||
- [MultiVector](type-aliases/MultiVector.md)
|
- [MultiVector](type-aliases/MultiVector.md)
|
||||||
- [RecordBatchLike](type-aliases/RecordBatchLike.md)
|
- [RecordBatchLike](type-aliases/RecordBatchLike.md)
|
||||||
- [SchemaLike](type-aliases/SchemaLike.md)
|
- [SchemaLike](type-aliases/SchemaLike.md)
|
||||||
- [TableLike](type-aliases/TableLike.md)
|
- [TableLike](type-aliases/TableLike.md)
|
||||||
- [TokenizeTableOptions](type-aliases/TokenizeTableOptions.md)
|
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
- [RecordBatchIterator](functions/RecordBatchIterator.md)
|
- [RecordBatchIterator](functions/RecordBatchIterator.md)
|
||||||
- [connect](functions/connect.md)
|
- [connect](functions/connect.md)
|
||||||
- [connectNamespace](functions/connectNamespace.md)
|
- [connectNamespace](functions/connectNamespace.md)
|
||||||
- [instrumentLanceDbMetrics](functions/instrumentLanceDbMetrics.md)
|
|
||||||
- [makeArrowTable](functions/makeArrowTable.md)
|
- [makeArrowTable](functions/makeArrowTable.md)
|
||||||
- [packBits](functions/packBits.md)
|
- [packBits](functions/packBits.md)
|
||||||
- [permutationBuilder](functions/permutationBuilder.md)
|
- [permutationBuilder](functions/permutationBuilder.md)
|
||||||
- [tokenize](functions/tokenize.md)
|
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / BranchColumnChange
|
|
||||||
|
|
||||||
# Interface: BranchColumnChange
|
|
||||||
|
|
||||||
A column whose definition differs between main and the branch.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### branch
|
|
||||||
|
|
||||||
```ts
|
|
||||||
branch: BranchColumnSummary;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### main
|
|
||||||
|
|
||||||
```ts
|
|
||||||
main: BranchColumnSummary;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### name
|
|
||||||
|
|
||||||
```ts
|
|
||||||
name: string;
|
|
||||||
```
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / BranchColumnSummary
|
|
||||||
|
|
||||||
# Interface: BranchColumnSummary
|
|
||||||
|
|
||||||
Summary of a column in a branch diff.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### dataType
|
|
||||||
|
|
||||||
```ts
|
|
||||||
dataType: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### name
|
|
||||||
|
|
||||||
```ts
|
|
||||||
name: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### nullable
|
|
||||||
|
|
||||||
```ts
|
|
||||||
nullable: boolean;
|
|
||||||
```
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / BranchDiff
|
|
||||||
|
|
||||||
# Interface: BranchDiff
|
|
||||||
|
|
||||||
Read-only comparison of a branch against main.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### addedColumns
|
|
||||||
|
|
||||||
```ts
|
|
||||||
addedColumns: BranchColumnSummary[];
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### addedIndexes
|
|
||||||
|
|
||||||
```ts
|
|
||||||
addedIndexes: BranchIndexSummary[];
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### baseMoved
|
|
||||||
|
|
||||||
```ts
|
|
||||||
baseMoved: boolean;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### branchVersion
|
|
||||||
|
|
||||||
```ts
|
|
||||||
branchVersion: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### changedColumns
|
|
||||||
|
|
||||||
```ts
|
|
||||||
changedColumns: BranchColumnChange[];
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### errors
|
|
||||||
|
|
||||||
```ts
|
|
||||||
errors: CherryPickError[];
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### fromBranch
|
|
||||||
|
|
||||||
```ts
|
|
||||||
fromBranch: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### mainVersion
|
|
||||||
|
|
||||||
```ts
|
|
||||||
mainVersion: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### parentVersion
|
|
||||||
|
|
||||||
```ts
|
|
||||||
parentVersion: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### removedColumns
|
|
||||||
|
|
||||||
```ts
|
|
||||||
removedColumns: BranchColumnSummary[];
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### removedIndexes
|
|
||||||
|
|
||||||
```ts
|
|
||||||
removedIndexes: BranchIndexSummary[];
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### rowCountBranch
|
|
||||||
|
|
||||||
```ts
|
|
||||||
rowCountBranch: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### rowCountMain
|
|
||||||
|
|
||||||
```ts
|
|
||||||
rowCountMain: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### rowSummary
|
|
||||||
|
|
||||||
```ts
|
|
||||||
rowSummary: BranchRowCountSummary;
|
|
||||||
```
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / BranchIndexSummary
|
|
||||||
|
|
||||||
# Interface: BranchIndexSummary
|
|
||||||
|
|
||||||
Summary of an index in a branch diff.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### columns
|
|
||||||
|
|
||||||
```ts
|
|
||||||
columns: string[];
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### indexName
|
|
||||||
|
|
||||||
```ts
|
|
||||||
indexName: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### indexType?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional indexType: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### status
|
|
||||||
|
|
||||||
```ts
|
|
||||||
status: string;
|
|
||||||
```
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / BranchRowCountSummary
|
|
||||||
|
|
||||||
# Interface: BranchRowCountSummary
|
|
||||||
|
|
||||||
Row-level comparison between main and the branch.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### deltaAvailable
|
|
||||||
|
|
||||||
```ts
|
|
||||||
deltaAvailable: boolean;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### inputsChanged
|
|
||||||
|
|
||||||
```ts
|
|
||||||
inputsChanged: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### newOnBase
|
|
||||||
|
|
||||||
```ts
|
|
||||||
newOnBase: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### newOnBranch
|
|
||||||
|
|
||||||
```ts
|
|
||||||
newOnBranch: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### staleRecompute
|
|
||||||
|
|
||||||
```ts
|
|
||||||
staleRecompute: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### unchanged
|
|
||||||
|
|
||||||
```ts
|
|
||||||
unchanged: number;
|
|
||||||
```
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / BucketStats
|
|
||||||
|
|
||||||
# Interface: BucketStats
|
|
||||||
|
|
||||||
Live state of one bucket. A table is N buckets on one node; flattening to a
|
|
||||||
single number hides the one hot bucket that is usually why someone opened
|
|
||||||
this endpoint.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### compacting
|
|
||||||
|
|
||||||
```ts
|
|
||||||
compacting: boolean;
|
|
||||||
```
|
|
||||||
|
|
||||||
Whether a pass owns this bucket's compaction latch right now. Says *a*
|
|
||||||
driver is running, not *whose*, and the latch is held from dispatch —
|
|
||||||
including while the pass queues for a pod-wide compactor permit. Read it
|
|
||||||
as "do not pile on", never as "mine is progressing".
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### currentGeneration
|
|
||||||
|
|
||||||
```ts
|
|
||||||
currentGeneration: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
The generation the active memtable will become.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### generations
|
|
||||||
|
|
||||||
```ts
|
|
||||||
generations: GenerationStats[];
|
|
||||||
```
|
|
||||||
|
|
||||||
Flushed L0 generations not yet merged into the base table.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### manifestVersion
|
|
||||||
|
|
||||||
```ts
|
|
||||||
manifestVersion: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Version of the shard manifest these numbers were read from.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### memtables?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional memtables: MemtableStats[];
|
|
||||||
```
|
|
||||||
|
|
||||||
Oldest first, active last. Absent for a `"Sealed"` bucket, whose
|
|
||||||
in-memory state is torn down.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### replayAfterWalEntryPosition
|
|
||||||
|
|
||||||
```ts
|
|
||||||
replayAfterWalEntryPosition: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
WAL position replay resumes from.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### shardId
|
|
||||||
|
|
||||||
```ts
|
|
||||||
shardId: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
The shard this bucket writes.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### status
|
|
||||||
|
|
||||||
```ts
|
|
||||||
status: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
`"Active"` or `"Sealed"` (drop-table 2PC in flight).
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### walEntryPositionLastSeen
|
|
||||||
|
|
||||||
```ts
|
|
||||||
walEntryPositionLastSeen: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Highest WAL position the writer has seen. The difference against
|
|
||||||
`replayAfterWalEntryPosition` is the WAL lag.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### writerEpoch
|
|
||||||
|
|
||||||
```ts
|
|
||||||
writerEpoch: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Epoch of the writer that currently owns the shard.
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / CherryPickError
|
|
||||||
|
|
||||||
# Interface: CherryPickError
|
|
||||||
|
|
||||||
A reason why a cherry-pick cannot currently land.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### code
|
|
||||||
|
|
||||||
```ts
|
|
||||||
code: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### message
|
|
||||||
|
|
||||||
```ts
|
|
||||||
message: string;
|
|
||||||
```
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / CherryPickPreview
|
|
||||||
|
|
||||||
# Interface: CherryPickPreview
|
|
||||||
|
|
||||||
Changes that would be, or were, promoted by a cherry-pick.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### promotedColumns
|
|
||||||
|
|
||||||
```ts
|
|
||||||
promotedColumns: string[];
|
|
||||||
```
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / CherryPickResult
|
|
||||||
|
|
||||||
# Interface: CherryPickResult
|
|
||||||
|
|
||||||
Result of previewing or attempting a cherry-pick.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### diff
|
|
||||||
|
|
||||||
```ts
|
|
||||||
diff: BranchDiff;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### mainVersionAfter?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional mainVersionAfter: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### preview
|
|
||||||
|
|
||||||
```ts
|
|
||||||
preview: CherryPickPreview;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### status
|
|
||||||
|
|
||||||
```ts
|
|
||||||
status:
|
|
||||||
| "failed"
|
|
||||||
| "unknown"
|
|
||||||
| "ready"
|
|
||||||
| "notImplemented"
|
|
||||||
| "cherryPicked";
|
|
||||||
```
|
|
||||||
@@ -64,19 +64,6 @@ client used by manifest-enabled native connections.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### oauthConfig?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional oauthConfig: NativeOAuthConfig;
|
|
||||||
```
|
|
||||||
|
|
||||||
(For LanceDB cloud only): OAuth configuration for IdP-based
|
|
||||||
authentication (e.g., Azure Entra ID). When set, token acquisition
|
|
||||||
and refresh are handled entirely in Rust. TypeScript users should pass
|
|
||||||
the public `OAuthConfig` type exported from `@lancedb/lancedb`.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### readConsistencyInterval?
|
### readConsistencyInterval?
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / FieldMetadataUpdate
|
|
||||||
|
|
||||||
# Interface: FieldMetadataUpdate
|
|
||||||
|
|
||||||
A per-field metadata update, addressed by dot-path.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### metadata
|
|
||||||
|
|
||||||
```ts
|
|
||||||
metadata: Record<string, null | string>;
|
|
||||||
```
|
|
||||||
|
|
||||||
Metadata key/value pairs. Merged into the field's existing metadata by
|
|
||||||
default; a value of `null` deletes that key. See
|
|
||||||
[Table.updateFieldMetadata](../classes/Table.md#updatefieldmetadata) for the conventional `lancedb:*` keys.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### path
|
|
||||||
|
|
||||||
```ts
|
|
||||||
path: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Dot-separated path to the field. For a top-level column this is just its
|
|
||||||
name; for a nested field it's the path, e.g. "a.b.c".
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### replace?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional replace: boolean;
|
|
||||||
```
|
|
||||||
|
|
||||||
If true, replace the field's entire metadata map instead of merging.
|
|
||||||
@@ -23,7 +23,7 @@ whether to remove punctuation
|
|||||||
### baseTokenizer?
|
### baseTokenizer?
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
optional baseTokenizer: BaseTokenizer;
|
optional baseTokenizer: "raw" | "simple" | "whitespace" | "ngram";
|
||||||
```
|
```
|
||||||
|
|
||||||
The tokenizer to use when building the index.
|
The tokenizer to use when building the index.
|
||||||
@@ -37,38 +37,6 @@ The following tokenizers are available:
|
|||||||
|
|
||||||
"raw" - Raw tokenizer. This tokenizer does not split the text into tokens and indexes the entire text as a single token.
|
"raw" - Raw tokenizer. This tokenizer does not split the text into tokens and indexes the entire text as a single token.
|
||||||
|
|
||||||
"icu" - ICU dictionary-based word segmentation.
|
|
||||||
|
|
||||||
"icu/split" - ICU segmentation with simple-style delimiter splitting.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### blockSize?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional blockSize: 128 | 256;
|
|
||||||
```
|
|
||||||
|
|
||||||
Number of documents per compressed posting block.
|
|
||||||
|
|
||||||
The default is 128. Supported values are 128 and 256. A value of 256 uses
|
|
||||||
the experimental FTS V3 format and may introduce breaking changes.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### customStopWords?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional customStopWords: string[];
|
|
||||||
```
|
|
||||||
|
|
||||||
Custom stop words that replace the built-in list for `language`.
|
|
||||||
|
|
||||||
This option only affects tokenization when `removeStopWords` is true.
|
|
||||||
|
|
||||||
`undefined` keeps the built-in language list. An empty array explicitly
|
|
||||||
replaces it with no stop words.
|
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### language?
|
### language?
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / FtsToken
|
|
||||||
|
|
||||||
# Interface: FtsToken
|
|
||||||
|
|
||||||
Token produced by the tokenizer configured on a full-text search index.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### position
|
|
||||||
|
|
||||||
```ts
|
|
||||||
position: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Token position used by full-text query matching.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### text
|
|
||||||
|
|
||||||
```ts
|
|
||||||
text: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Token text after tokenizer filters have been applied.
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / GenerationStats
|
|
||||||
|
|
||||||
# Interface: GenerationStats
|
|
||||||
|
|
||||||
One flushed L0 generation.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### bytes
|
|
||||||
|
|
||||||
```ts
|
|
||||||
bytes: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
On-disk size of the generation.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### generation
|
|
||||||
|
|
||||||
```ts
|
|
||||||
generation: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
The generation number. Increases as memtables are sealed into L0.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### rows?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional rows: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Present only when `includeGenerationRows` was requested. Off by default
|
|
||||||
because each count opens an uncached Lance dataset.
|
|
||||||
@@ -23,31 +23,6 @@ be more columns to represent composite indices.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### createdAt?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional createdAt: Date;
|
|
||||||
```
|
|
||||||
|
|
||||||
When the index was created.
|
|
||||||
|
|
||||||
`undefined` for remote tables or indices created before timestamps were tracked.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### indexDetails?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional indexDetails: any;
|
|
||||||
```
|
|
||||||
|
|
||||||
Index-type-specific details parsed as a JavaScript object.
|
|
||||||
|
|
||||||
Falls back to a raw string if JSON parsing fails. `undefined` for
|
|
||||||
remote tables or when details are unavailable.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### indexType
|
### indexType
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -58,30 +33,6 @@ The type of the index
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### indexUuid?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional indexUuid: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
The UUID of the first segment of the index.
|
|
||||||
|
|
||||||
`undefined` for remote tables, which do not yet surface this.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### indexVersion?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional indexVersion: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
The on-disk index format version.
|
|
||||||
|
|
||||||
`undefined` for remote tables.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### name
|
### name
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -89,63 +40,3 @@ name: string;
|
|||||||
```
|
```
|
||||||
|
|
||||||
The name of the index
|
The name of the index
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### numIndexedRows?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional numIndexedRows: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
The number of rows indexed, across all segments.
|
|
||||||
|
|
||||||
`undefined` for remote tables.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### numSegments?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional numSegments: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
The number of segments that make up the index.
|
|
||||||
|
|
||||||
`undefined` for remote tables.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### numUnindexedRows?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional numUnindexedRows: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
The number of rows not yet covered by this index.
|
|
||||||
|
|
||||||
`undefined` for remote tables.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### sizeBytes?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional sizeBytes: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
The total size in bytes of all index files across all segments.
|
|
||||||
|
|
||||||
`undefined` for remote tables or indices without size tracking.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### typeUrl?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional typeUrl: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
The protobuf type URL, a precise type identifier for the index.
|
|
||||||
|
|
||||||
`undefined` for remote tables.
|
|
||||||
|
|||||||
@@ -30,6 +30,17 @@ The type of the index
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
|
### loss?
|
||||||
|
|
||||||
|
```ts
|
||||||
|
optional loss: number;
|
||||||
|
```
|
||||||
|
|
||||||
|
The KMeans loss value of the index,
|
||||||
|
it is only present for vector indices.
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
### numIndexedRows
|
### numIndexedRows
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / JobDescription
|
|
||||||
|
|
||||||
# Interface: JobDescription
|
|
||||||
|
|
||||||
A described job from `Connection.getJob`.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### creationMs
|
|
||||||
|
|
||||||
```ts
|
|
||||||
creationMs: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
When the job was created, in milliseconds since the epoch.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### failure?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional failure: JobFailureInfo;
|
|
||||||
```
|
|
||||||
|
|
||||||
Why the job failed, when the job is failed and the server reports a
|
|
||||||
reason.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### jobId
|
|
||||||
|
|
||||||
```ts
|
|
||||||
jobId: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### jobType
|
|
||||||
|
|
||||||
```ts
|
|
||||||
jobType: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### specJson?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional specJson: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
The job-type-specific specification as a JSON string, when present.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### state
|
|
||||||
|
|
||||||
```ts
|
|
||||||
state: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Lifecycle state: "running", "finished", "failed", or "cancelled".
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / JobFailureInfo
|
|
||||||
|
|
||||||
# Interface: JobFailureInfo
|
|
||||||
|
|
||||||
The server's account of why a job failed.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### message?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional message: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### phase?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional phase: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### retryable?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional retryable: boolean;
|
|
||||||
```
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / JobInfo
|
|
||||||
|
|
||||||
# Interface: JobInfo
|
|
||||||
|
|
||||||
A row from `Connection.listJobs`: one server-side job.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### createdAtMillis
|
|
||||||
|
|
||||||
```ts
|
|
||||||
createdAtMillis: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
When the job was created, in milliseconds since the epoch.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### jobId
|
|
||||||
|
|
||||||
```ts
|
|
||||||
jobId: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
The job id -- what `Connection.getJob` and `Connection.cancelJob`
|
|
||||||
accept.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### jobType
|
|
||||||
|
|
||||||
```ts
|
|
||||||
jobType: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### state
|
|
||||||
|
|
||||||
```ts
|
|
||||||
state: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Lifecycle state: "running", "finished", "failed", or "cancelled".
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### table
|
|
||||||
|
|
||||||
```ts
|
|
||||||
table: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
The table the job runs against, without URI or namespace.
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / ListTablesOptions
|
|
||||||
|
|
||||||
# Interface: ListTablesOptions
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### limit?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional limit: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
An upper bound on how many tables to return.
|
|
||||||
|
|
||||||
A page may hold fewer than this and still not be the last one, so keep
|
|
||||||
going while the response carries a page token rather than while pages are
|
|
||||||
full.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### pageToken?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional pageToken: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Token from a previous response, to resume listing where it left off.
|
|
||||||
|
|
||||||
The token is opaque: it carries whatever the database needs to resume, and
|
|
||||||
callers should not construct or interpret one.
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / ListTablesResponse
|
|
||||||
|
|
||||||
# Interface: ListTablesResponse
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### pageToken?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional pageToken: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### tables
|
|
||||||
|
|
||||||
```ts
|
|
||||||
tables: string[];
|
|
||||||
```
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / LsmStats
|
|
||||||
|
|
||||||
# Interface: LsmStats
|
|
||||||
|
|
||||||
Live per-bucket LSM state, as returned by `Table#getLsmStats`.
|
|
||||||
|
|
||||||
Nothing here is derived: sums and differences (total L0 bytes, WAL lag) are
|
|
||||||
the caller's to compute.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### buckets
|
|
||||||
|
|
||||||
```ts
|
|
||||||
buckets: BucketStats[];
|
|
||||||
```
|
|
||||||
|
|
||||||
One entry per bucket backing this table.
|
|
||||||
@@ -11,10 +11,7 @@ Specification selecting Lance's MemWAL LSM-style write path for
|
|||||||
|
|
||||||
`specType` is `"bucket"`, `"identity"`, or `"unsharded"`. For `"bucket"`,
|
`specType` is `"bucket"`, `"identity"`, or `"unsharded"`. For `"bucket"`,
|
||||||
`column` and `numBuckets` are required; for `"identity"`, `column` is
|
`column` and `numBuckets` are required; for `"identity"`, `column` is
|
||||||
required and must be a deterministic function of the unenforced primary
|
required.
|
||||||
key (every row with a given primary key must always produce the same
|
|
||||||
`column` value, or upserts of that key can land in different shards and a
|
|
||||||
stale version can win).
|
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
@@ -34,9 +31,7 @@ Bucket and identity variants: the sharding column.
|
|||||||
optional maintainedIndexes: string[];
|
optional maintainedIndexes: string[];
|
||||||
```
|
```
|
||||||
|
|
||||||
Indexes the MemWAL keeps up to date. Omit to maintain every supported
|
Names of indexes the MemWAL should keep up to date during writes.
|
||||||
index, resolved on install — a snapshot, so indexes created later are not
|
|
||||||
maintained. Pass `[]` for none.
|
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / MaterializedViewDefinition
|
|
||||||
|
|
||||||
# Interface: MaterializedViewDefinition
|
|
||||||
|
|
||||||
The query that defines a materialized view.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### filter?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional filter: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
SQL predicate selecting the source rows the view holds.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### inputs
|
|
||||||
|
|
||||||
```ts
|
|
||||||
inputs: string[];
|
|
||||||
```
|
|
||||||
|
|
||||||
Source columns the projections and filter read.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### limit?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional limit: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Cap on the number of rows the view holds.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### projections
|
|
||||||
|
|
||||||
```ts
|
|
||||||
projections: [string, string][];
|
|
||||||
```
|
|
||||||
|
|
||||||
`[output column, SQL expression]` pairs, in view schema order.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### sourceTable
|
|
||||||
|
|
||||||
```ts
|
|
||||||
sourceTable: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Name of the source table, in the same database as the view.
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / MemtableStats
|
|
||||||
|
|
||||||
# Interface: MemtableStats
|
|
||||||
|
|
||||||
One in-memory memtable.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### batches
|
|
||||||
|
|
||||||
```ts
|
|
||||||
batches: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Record batches currently buffered.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### bytes
|
|
||||||
|
|
||||||
```ts
|
|
||||||
bytes: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Estimated in-memory size.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### generation
|
|
||||||
|
|
||||||
```ts
|
|
||||||
generation: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
The generation this memtable will become once sealed.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### indexes
|
|
||||||
|
|
||||||
```ts
|
|
||||||
indexes: string[];
|
|
||||||
```
|
|
||||||
|
|
||||||
Names of the indexes this memtable carries. An absent name is the whole
|
|
||||||
answer to "why is my fresh-tier search on that column brute-force".
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### rows
|
|
||||||
|
|
||||||
```ts
|
|
||||||
rows: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Rows currently buffered.
|
|
||||||
@@ -32,14 +32,6 @@ numInsertedRows: number;
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### numRows
|
|
||||||
|
|
||||||
```ts
|
|
||||||
numRows: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### numUpdatedRows
|
### numUpdatedRows
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|||||||
@@ -1,88 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / NativeOAuthConfig
|
|
||||||
|
|
||||||
# Interface: NativeOAuthConfig
|
|
||||||
|
|
||||||
OAuth configuration for LanceDB authentication.
|
|
||||||
|
|
||||||
This is the generated napi-rs binding shape. TypeScript users should prefer
|
|
||||||
the public `OAuthConfig` type exported from `@lancedb/lancedb`.
|
|
||||||
|
|
||||||
All token acquisition and refresh is handled in the Rust layer.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### clientId
|
|
||||||
|
|
||||||
```ts
|
|
||||||
clientId: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Application / Client ID.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### clientSecret?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional clientSecret: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Client secret (required for client_credentials).
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### flow?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional flow: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Authentication flow: "client_credentials" or "azure_managed_identity"
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### issuerUrl
|
|
||||||
|
|
||||||
```ts
|
|
||||||
issuerUrl: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
OIDC issuer URL or OAuth authority URL.
|
|
||||||
For Azure: `https://login.microsoftonline.com/{tenant_id}/v2.0`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### managedIdentityClientId?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional managedIdentityClientId: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Client ID for user-assigned managed identity (azure_managed_identity).
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### refreshBufferSecs?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional refreshBufferSecs: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Seconds before expiry to trigger proactive refresh (default: 300).
|
|
||||||
Keep this well below the token TTL; if it is greater than or equal to
|
|
||||||
the TTL, each request refreshes the token.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### scopes
|
|
||||||
|
|
||||||
```ts
|
|
||||||
scopes: string[];
|
|
||||||
```
|
|
||||||
|
|
||||||
OAuth scopes to request. For Azure managed identity, exactly one scope
|
|
||||||
or resource is required. For example: `["api://{app_id}/.default"]`
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / OAuthConfig
|
|
||||||
|
|
||||||
# Interface: OAuthConfig
|
|
||||||
|
|
||||||
OAuth configuration for LanceDB authentication.
|
|
||||||
|
|
||||||
This is the public TypeScript OAuth configuration type. The generated
|
|
||||||
`NativeOAuthConfig` type has the same runtime shape but is an implementation
|
|
||||||
detail of the napi-rs binding.
|
|
||||||
|
|
||||||
All token acquisition and refresh is handled in the Rust layer.
|
|
||||||
This config is passed through to Rust via napi-rs.
|
|
||||||
|
|
||||||
## Examples
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
const config: OAuthConfig = {
|
|
||||||
issuerUrl: "https://login.microsoftonline.com/{tenant}/v2.0",
|
|
||||||
clientId: "app-id",
|
|
||||||
clientSecret: "secret",
|
|
||||||
scopes: ["api://lancedb-api/.default"],
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
const config: OAuthConfig = {
|
|
||||||
issuerUrl: "https://login.microsoftonline.com/{tenant}/v2.0",
|
|
||||||
clientId: "app-id",
|
|
||||||
scopes: ["api://lancedb-api/.default"],
|
|
||||||
flow: OAuthFlowType.AzureManagedIdentity,
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### clientId
|
|
||||||
|
|
||||||
```ts
|
|
||||||
clientId: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Application / Client ID.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### clientSecret?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional clientSecret: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Client secret (required for ClientCredentials).
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### flow?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional flow: OAuthFlowType;
|
|
||||||
```
|
|
||||||
|
|
||||||
Authentication flow (default: ClientCredentials).
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### issuerUrl
|
|
||||||
|
|
||||||
```ts
|
|
||||||
issuerUrl: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
OIDC issuer URL or OAuth authority URL.
|
|
||||||
For Azure: `https://login.microsoftonline.com/{tenant_id}/v2.0`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### managedIdentityClientId?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional managedIdentityClientId: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Client ID for user-assigned managed identity (AzureManagedIdentity).
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### refreshBufferSecs?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional refreshBufferSecs: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Seconds before expiry to trigger proactive refresh (default: 300).
|
|
||||||
Keep this well below the token TTL; if it is greater than or equal to
|
|
||||||
the TTL, each request refreshes the token.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### scopes
|
|
||||||
|
|
||||||
```ts
|
|
||||||
scopes: string[];
|
|
||||||
```
|
|
||||||
|
|
||||||
OAuth scopes to request.
|
|
||||||
For Azure managed identity, exactly one scope or resource is required.
|
|
||||||
For example: `["api://{app_id}/.default"]`
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user