Compare commits

...

4 Commits

Author SHA1 Message Date
Lance Release
e9011b71b1 Bump version: 0.4.15 → 0.4.16 2024-04-04 21:39:58 +00:00
Will Jones
1b605ecc3b chore: upgrade to lance-0.10.9 (#1192) 2024-04-04 14:39:24 -07:00
QianZhu
bcc879b74a add a default value for search.limit to be consistent with python sdk (#1191)
Changed the default value for search.limit to be 10
2024-04-04 12:22:10 -07:00
Bert
fad0b76159 ensure table names are uri encoded for tables (#1189)
This prevents an issue where users can do something like:
```js
db.createTable('my-table#123123')
```
The server has logic to determine that '#' character is not allowed in
the table name, but currently this is being returned as 404 error
because it routes to `/v1/my-table#123123/create` and `#123123/create`
will not be parsed as part of path
2024-04-04 10:48:07 -07:00
14 changed files with 42 additions and 41 deletions

View File

@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.4.15
current_version = 0.4.16
commit = True
message = Bump version: {current_version} → {new_version}
tag = True

View File

@@ -14,10 +14,10 @@ keywords = ["lancedb", "lance", "database", "vector", "search"]
categories = ["database-implementations"]
[workspace.dependencies]
lance = { "version" = "=0.10.8", "features" = ["dynamodb"] }
lance-index = { "version" = "=0.10.8" }
lance-linalg = { "version" = "=0.10.8" }
lance-testing = { "version" = "=0.10.8" }
lance = { "version" = "=0.10.9", "features" = ["dynamodb"] }
lance-index = { "version" = "=0.10.9" }
lance-linalg = { "version" = "=0.10.9" }
lance-testing = { "version" = "=0.10.9" }
# Note that this one does not include pyarrow
arrow = { version = "50.0", optional = false }
arrow-array = "50.0"

View File

@@ -1,6 +1,6 @@
{
"name": "vectordb",
"version": "0.4.15",
"version": "0.4.16",
"description": " Serverless, low-latency vector database for AI applications",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -88,10 +88,10 @@
}
},
"optionalDependencies": {
"@lancedb/vectordb-darwin-arm64": "0.4.15",
"@lancedb/vectordb-darwin-x64": "0.4.15",
"@lancedb/vectordb-linux-arm64-gnu": "0.4.15",
"@lancedb/vectordb-linux-x64-gnu": "0.4.15",
"@lancedb/vectordb-win32-x64-msvc": "0.4.15"
"@lancedb/vectordb-darwin-arm64": "0.4.16",
"@lancedb/vectordb-darwin-x64": "0.4.16",
"@lancedb/vectordb-linux-arm64-gnu": "0.4.16",
"@lancedb/vectordb-linux-x64-gnu": "0.4.16",
"@lancedb/vectordb-win32-x64-msvc": "0.4.16"
}
}

View File

@@ -38,7 +38,7 @@ export class Query<T = number[]> {
constructor (query?: T, tbl?: any, embeddings?: EmbeddingFunction<T>) {
this._tbl = tbl
this._query = query
this._limit = undefined
this._limit = 10
this._nprobes = 20
this._refineFactor = undefined
this._select = undefined
@@ -50,6 +50,7 @@ export class Query<T = number[]> {
/***
* Sets the number of results that will be returned
* default value is 10
* @param value number of results
*/
limit (value: number): Query<T> {

View File

@@ -156,7 +156,7 @@ export class RemoteConnection implements Connection {
}
const res = await this._client.post(
`/v1/table/${tableName}/create/`,
`/v1/table/${encodeURIComponent(tableName)}/create/`,
buffer,
undefined,
'application/vnd.apache.arrow.stream'
@@ -177,7 +177,7 @@ export class RemoteConnection implements Connection {
}
async dropTable (name: string): Promise<void> {
await this._client.post(`/v1/table/${name}/drop/`)
await this._client.post(`/v1/table/${encodeURIComponent(name)}/drop/`)
}
withMiddleware (middleware: HttpMiddleware): Connection {
@@ -268,7 +268,7 @@ export class RemoteTable<T = number[]> implements Table<T> {
get schema (): Promise<any> {
return this._client
.post(`/v1/table/${this._name}/describe/`)
.post(`/v1/table/${encodeURIComponent(this._name)}/describe/`)
.then(async (res) => {
if (res.status !== 200) {
throw new Error(
@@ -282,7 +282,7 @@ export class RemoteTable<T = number[]> implements Table<T> {
}
search (query: T): Query<T> {
return new RemoteQuery(query, this._client, this._name) //, this._embeddings_new)
return new RemoteQuery(query, this._client, encodeURIComponent(this._name)) //, this._embeddings_new)
}
filter (where: string): Query<T> {
@@ -324,7 +324,7 @@ export class RemoteTable<T = number[]> implements Table<T> {
const buffer = await fromTableToStreamBuffer(tbl, this._embeddings)
const res = await this._client.post(
`/v1/table/${this._name}/merge_insert/`,
`/v1/table/${encodeURIComponent(this._name)}/merge_insert/`,
buffer,
queryParams,
'application/vnd.apache.arrow.stream'
@@ -348,7 +348,7 @@ export class RemoteTable<T = number[]> implements Table<T> {
const buffer = await fromTableToStreamBuffer(tbl, this._embeddings)
const res = await this._client.post(
`/v1/table/${this._name}/insert/`,
`/v1/table/${encodeURIComponent(this._name)}/insert/`,
buffer,
{
mode: 'append'
@@ -374,7 +374,7 @@ export class RemoteTable<T = number[]> implements Table<T> {
}
const buffer = await fromTableToStreamBuffer(tbl, this._embeddings)
const res = await this._client.post(
`/v1/table/${this._name}/insert/`,
`/v1/table/${encodeURIComponent(this._name)}/insert/`,
buffer,
{
mode: 'overwrite'
@@ -421,7 +421,7 @@ export class RemoteTable<T = number[]> implements Table<T> {
index_cache_size: indexCacheSize
}
const res = await this._client.post(
`/v1/table/${this._name}/create_index/`,
`/v1/table/${encodeURIComponent(this._name)}/create_index/`,
data
)
if (res.status !== 200) {
@@ -442,7 +442,7 @@ export class RemoteTable<T = number[]> implements Table<T> {
replace: true
}
const res = await this._client.post(
`/v1/table/${this._name}/create_scalar_index/`,
`/v1/table/${encodeURIComponent(this._name)}/create_scalar_index/`,
data
)
if (res.status !== 200) {
@@ -455,14 +455,14 @@ export class RemoteTable<T = number[]> implements Table<T> {
}
async countRows (filter?: string): Promise<number> {
const result = await this._client.post(`/v1/table/${this._name}/count_rows/`, {
const result = await this._client.post(`/v1/table/${encodeURIComponent(this._name)}/count_rows/`, {
predicate: filter
})
return (await result.body())
}
async delete (filter: string): Promise<void> {
await this._client.post(`/v1/table/${this._name}/delete/`, {
await this._client.post(`/v1/table/${encodeURIComponent(this._name)}/delete/`, {
predicate: filter
})
}
@@ -481,7 +481,7 @@ export class RemoteTable<T = number[]> implements Table<T> {
updates[key] = toSQL(value)
}
}
await this._client.post(`/v1/table/${this._name}/update/`, {
await this._client.post(`/v1/table/${encodeURIComponent(this._name)}/update/`, {
predicate: filter,
updates: Object.entries(updates).map(([key, value]) => [key, value])
})
@@ -489,7 +489,7 @@ export class RemoteTable<T = number[]> implements Table<T> {
async listIndices (): Promise<VectorIndex[]> {
const results = await this._client.post(
`/v1/table/${this._name}/index/list/`
`/v1/table/${encodeURIComponent(this._name)}/index/list/`
)
return (await results.body()).indexes?.map((index: any) => ({
columns: index.columns,
@@ -500,7 +500,7 @@ export class RemoteTable<T = number[]> implements Table<T> {
async indexStats (indexUuid: string): Promise<IndexStats> {
const results = await this._client.post(
`/v1/table/${this._name}/index/${indexUuid}/stats/`
`/v1/table/${encodeURIComponent(this._name)}/index/${indexUuid}/stats/`
)
const body = await results.body()
return {

View File

@@ -124,9 +124,9 @@ describe('LanceDB client', function () {
const uri = await createTestDB(2, 100)
const con = await lancedb.connect(uri)
const table = (await con.openTable('vectors')) as LocalTable
let results = await table.filter('id % 2 = 0').execute()
let results = await table.filter('id % 2 = 0').limit(100).execute()
assertResults(results)
results = await table.where('id % 2 = 0').execute()
results = await table.where('id % 2 = 0').limit(100).execute()
assertResults(results)
// Should reject a bad filter

View File

@@ -1,6 +1,6 @@
{
"name": "@lancedb/lancedb-darwin-arm64",
"version": "0.4.15",
"version": "0.4.16",
"os": [
"darwin"
],

View File

@@ -1,6 +1,6 @@
{
"name": "@lancedb/lancedb-darwin-x64",
"version": "0.4.15",
"version": "0.4.16",
"os": [
"darwin"
],

View File

@@ -1,6 +1,6 @@
{
"name": "@lancedb/lancedb-linux-arm64-gnu",
"version": "0.4.15",
"version": "0.4.16",
"os": [
"linux"
],

View File

@@ -1,6 +1,6 @@
{
"name": "@lancedb/lancedb-linux-x64-gnu",
"version": "0.4.15",
"version": "0.4.16",
"os": [
"linux"
],

View File

@@ -1,6 +1,6 @@
{
"name": "@lancedb/lancedb",
"version": "0.4.15",
"version": "0.4.16",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"napi": {
@@ -67,11 +67,11 @@
"version": "napi version"
},
"optionalDependencies": {
"@lancedb/lancedb-darwin-arm64": "0.4.15",
"@lancedb/lancedb-darwin-x64": "0.4.15",
"@lancedb/lancedb-linux-arm64-gnu": "0.4.15",
"@lancedb/lancedb-linux-x64-gnu": "0.4.15",
"@lancedb/lancedb-win32-x64-msvc": "0.4.15"
"@lancedb/lancedb-darwin-arm64": "0.4.16",
"@lancedb/lancedb-darwin-x64": "0.4.16",
"@lancedb/lancedb-linux-arm64-gnu": "0.4.16",
"@lancedb/lancedb-linux-x64-gnu": "0.4.16",
"@lancedb/lancedb-win32-x64-msvc": "0.4.16"
},
"dependencies": {
"openai": "^4.29.2",

View File

@@ -3,7 +3,7 @@ name = "lancedb"
version = "0.6.6"
dependencies = [
"deprecation",
"pylance==0.10.8",
"pylance==0.10.9",
"ratelimiter~=1.0",
"retry>=0.9.2",
"tqdm>=4.27.0",

View File

@@ -1,6 +1,6 @@
[package]
name = "lancedb-node"
version = "0.4.15"
version = "0.4.16"
description = "Serverless, low-latency vector database for AI applications"
license.workspace = true
edition.workspace = true

View File

@@ -1,6 +1,6 @@
[package]
name = "lancedb"
version = "0.4.15"
version = "0.4.16"
edition.workspace = true
description = "LanceDB: A serverless, low-latency vector database for AI applications"
license.workspace = true