Compare commits

..

3 Commits

Author SHA1 Message Date
albertlockett
c8d02e4440 upgrade lance to 0.17.0 2024-08-14 09:27:37 -03:00
Ryan Green
b3daa25f46 feat: allow new scalar index types to be created in remote table (#1538) 2024-08-13 16:05:42 -02:30
Matt Basta
6008a8257b fix: remove native.d.ts from .npmignore (#1531)
This removes the type definitions for a number of important TypeScript
interfaces from `.npmignore` so that the package is not incorrectly
typed `any` in a number of places.

---

Presently the `opts` argument to `lancedb.connect` is typed `any`, even
though it shouldn't be.

<img width="560" alt="image"
src="https://github.com/user-attachments/assets/5c974ce8-5a59-44a1-935d-cbb808f0ea24">

Clicking into the type definitions for the published package, it has the
correct type signature:

<img width="831" alt="image"
src="https://github.com/user-attachments/assets/6e39a519-13ff-4ca8-95ae-85538ac59d5d">

However, `ConnectionOptions` is imported from `native.js` (along with a
number of other imports a bit further down):

<img width="384" alt="image"
src="https://github.com/user-attachments/assets/10c1b055-ae78-4088-922e-2816af64c23c">

This is not otherwise an issue, except that the type definitions for
`native.js` are not included in the published package:

<img width="217" alt="image"
src="https://github.com/user-attachments/assets/f15cd3b6-a8de-4011-9fa2-391858da20ec">

I haven't compiled the Rust code and run the build script, but I
strongly suspect that disincluding the type definitions in `.npmignore`
is ultimately the root cause here.
2024-08-13 10:06:15 -07:00
5 changed files with 14 additions and 14 deletions

View File

@@ -20,14 +20,12 @@ keywords = ["lancedb", "lance", "database", "vector", "search"]
categories = ["database-implementations"]
[workspace.dependencies]
lance = { "version" = "=0.17.0", "features" = [
"dynamodb",
], git = "https://github.com/lancedb/lance.git", tag = "v0.17.0-beta.2" }
lance-index = { "version" = "=0.17.0", git = "https://github.com/lancedb/lance.git", tag = "v0.17.0-beta.2" }
lance-linalg = { "version" = "=0.17.0", git = "https://github.com/lancedb/lance.git", tag = "v0.17.0-beta.2" }
lance-testing = { "version" = "=0.17.0", git = "https://github.com/lancedb/lance.git", tag = "v0.17.0-beta.2" }
lance-datafusion = { "version" = "=0.17.0", git = "https://github.com/lancedb/lance.git", tag = "v0.17.0-beta.2" }
lance-encoding = { "version" = "=0.17.0", git = "https://github.com/lancedb/lance.git", tag = "v0.17.0-beta.2" }
lance = { "version" = "=0.17.0", "features" = ["dynamodb"] }
lance-index = { "version" = "=0.17.0" }
lance-linalg = { "version" = "=0.17.0" }
lance-testing = { "version" = "=0.17.0" }
lance-datafusion = { "version" = "=0.17.0" }
lance-encoding = { "version" = "=0.17.0" }
# Note that this one does not include pyarrow
arrow = { version = "52.2", optional = false }
arrow-array = "52.2"

View File

@@ -20,6 +20,5 @@ Cargo.toml
biome.json
build.rs
jest.config.js
native.d.ts
tsconfig.json
typedoc.json
typedoc.json

View File

@@ -3,7 +3,7 @@ name = "lancedb"
# version in Cargo.toml
dependencies = [
"deprecation",
"pylance==0.17.0-beta.2",
"pylance==0.16.1",
"ratelimiter~=1.0",
"requests>=2.31.0",
"retry>=0.9.2",

View File

@@ -15,7 +15,7 @@ import logging
import uuid
from concurrent.futures import Future
from functools import cached_property
from typing import Dict, Iterable, Optional, Union
from typing import Dict, Iterable, Optional, Union, Literal
import pyarrow as pa
from lance import json_to_schema
@@ -97,6 +97,7 @@ class RemoteTable(Table):
def create_scalar_index(
self,
column: str,
index_type: Literal["BTREE", "BITMAP", "LABEL_LIST", "scalar"] = "scalar",
):
"""Creates a scalar index
Parameters
@@ -104,8 +105,10 @@ class RemoteTable(Table):
column : str
The column to be indexed. Must be a boolean, integer, float,
or string column.
index_type : str
The index type of the scalar index. Must be "scalar" (BTREE),
"BTREE", "BITMAP", or "LABEL_LIST"
"""
index_type = "scalar"
data = {
"column": column,

View File

@@ -2781,7 +2781,7 @@ mod tests {
.get_index_type(index_uuid)
.await
.unwrap(),
Some("IVF_PQ".to_string())
Some("IVF".to_string())
);
assert_eq!(
table