Compare commits

..

8 Commits

Author SHA1 Message Date
albertlockett
a2fa15606f Revert "support passing write parameters to merge_insert"
This reverts commit 783e99feb7.
2024-07-19 11:28:07 -03:00
albertlockett
c011539905 Revert "added capability to pass WriteParams to delete"
This reverts commit 1415d1a23a.
2024-07-19 11:25:57 -03:00
albertlockett
2e1f4bfc62 change lancedb path temporarily 2024-07-19 11:25:44 -03:00
albertlockett
cc24edf417 Revert "support passing WriteParams to update"
This reverts commit 1c229a90ea.
2024-07-19 11:07:30 -03:00
albertlockett
783e99feb7 support passing write parameters to merge_insert 2024-07-18 16:00:53 -03:00
albertlockett
1415d1a23a added capability to pass WriteParams to delete 2024-07-18 15:36:33 -03:00
albertlockett
1c229a90ea support passing WriteParams to update 2024-07-18 15:09:58 -03:00
rmeng
cc114ada72 feat: upgrade to 0.14.2 2024-07-13 21:25:59 -04:00
8 changed files with 27 additions and 57 deletions

View File

@@ -20,11 +20,18 @@ keywords = ["lancedb", "lance", "database", "vector", "search"]
categories = ["database-implementations"]
[workspace.dependencies]
lance = { "version" = "=0.14.1", "features" = ["dynamodb"] }
lance-index = { "version" = "=0.14.1" }
lance-linalg = { "version" = "=0.14.1" }
lance-testing = { "version" = "=0.14.1" }
lance-datafusion = { "version" = "=0.14.1" }
# lance = { "version" = "=0.14.2", "features" = ["dynamodb"] }
# lance-index = { "version" = "=0.14.2" }
# lance-linalg = { "version" = "=0.14.2" }
# lance-testing = { "version" = "=0.14.2" }
# lance-datafusion = { "version" = "=0.14.2" }
lance = { path="../lance/rust/lance", "features" = ["dynamodb"] }
lance-index = { path="../lance/rust/lance-index" }
lance-linalg = { path="../lance/rust/lance-linalg" }
lance-testing = { path="../lance/rust/lance-testing" }
lance-datafusion = { path="../lance/rust/lance-datafusion" }
# Note that this one does not include pyarrow
arrow = { version = "51.0", optional = false }
arrow-array = "51.0"

View File

@@ -109,7 +109,7 @@ nav:
- Filtering: sql.md
- Versioning & Reproducibility: notebooks/reproducibility.ipynb
- Configuring Storage: guides/storage.md
- Migration Guide: migration.md
- Sync -> Async Migration Guide: migration.md
- Tuning retrieval performance:
- Choosing right query type: guides/tuning_retrievers/1_query_types.md
- Reranking: guides/tuning_retrievers/2_reranking.md
@@ -194,7 +194,7 @@ nav:
- Filtering: sql.md
- Versioning & Reproducibility: notebooks/reproducibility.ipynb
- Configuring Storage: guides/storage.md
- Migration Guide: migration.md
- Sync -> Async Migration Guide: migration.md
- Tuning retrieval performance:
- Choosing right query type: guides/tuning_retrievers/1_query_types.md
- Reranking: guides/tuning_retrievers/2_reranking.md

View File

@@ -9,8 +9,7 @@ around the asynchronous client.
This guide describes the differences between the two APIs and will hopefully assist users
that would like to migrate to the new API.
## Python
### Closeable Connections
## Closeable Connections
The Connection now has a `close` method. You can call this when
you are done with the connection to eagerly free resources. Currently
@@ -33,20 +32,20 @@ async def my_async_fn():
It is not mandatory to call the `close` method. If you do not call it
then the connection will be closed when the object is garbage collected.
### Closeable Table
## Closeable Table
The Table now also has a `close` method, similar to the connection. This
can be used to eagerly free the cache used by a Table object. Similar to
the connection, it can be used as a context manager and it is not mandatory
to call the `close` method.
#### Changes to Table APIs
### Changes to Table APIs
- Previously `Table.schema` was a property. Now it is an async method.
- The method `Table.__len__` was removed and `len(table)` will no longer
work. Use `Table.count_rows` instead.
#### Creating Indices
### Creating Indices
The `Table.create_index` method is now used for creating both vector indices
and scalar indices. It currently requires a column name to be specified (the
@@ -56,12 +55,12 @@ the size of the data.
To specify index configuration details you will need to specify which kind of
index you are using.
#### Querying
### Querying
The `Table.search` method has been renamed to `AsyncTable.vector_search` for
clarity.
### Features not yet supported
## Features not yet supported
The following features are not yet supported by the asynchronous API. However,
we plan to support them soon.
@@ -75,22 +74,3 @@ we plan to support them soon.
search
- Remote connections to LanceDb Cloud are not yet supported.
- The method Table.head is not yet supported.
## TypeScript/JavaScript
For JS/TS users, we offer a brand new SDK [@lancedb/lancedb](https://www.npmjs.com/package/@lancedb/lancedb)
### Changes to Table APIs
Previously `Table.schema` was a property. Now it is an async method.
#### Creating Indices
The `Table.createIndex` method is now used for creating both vector indices
and scalar indices. It currently requires a column name to be specified (the
column to index). Vector index defaults are now smarter and scale better with
the size of the data.
To specify index configuration details you will need to specify which kind of
index you are using.

View File

@@ -62,8 +62,6 @@ export {
const defaultAwsRegion = "us-west-2";
const defaultRequestTimeout = 10_000
export interface AwsCredentials {
accessKeyId: string
@@ -121,11 +119,6 @@ export interface ConnectionOptions {
*/
hostOverride?: string
/**
* Duration in milliseconds for request timeout. Default = 10,000 (10 seconds)
*/
timeout?: number
/**
* (For LanceDB OSS only): The interval, in seconds, at which to check for
* updates to the table from other processes. If None, then consistency is not
@@ -211,8 +204,7 @@ export async function connect(
awsCredentials: undefined,
awsRegion: defaultAwsRegion,
apiKey: undefined,
region: defaultAwsRegion,
timeout: defaultRequestTimeout
region: defaultAwsRegion
},
arg
);

View File

@@ -41,7 +41,7 @@ async function callWithMiddlewares (
if (i > middlewares.length) {
const headers = Object.fromEntries(req.headers.entries())
const params = Object.fromEntries(req.params?.entries() ?? [])
const timeout = opts?.timeout
const timeout = 10000
let res
if (req.method === Method.POST) {
res = await axios.post(
@@ -82,7 +82,6 @@ async function callWithMiddlewares (
interface MiddlewareInvocationOptions {
responseType?: ResponseType
timeout?: number,
}
/**
@@ -124,19 +123,15 @@ export class HttpLancedbClient {
private readonly _url: string
private readonly _apiKey: () => string
private readonly _middlewares: HttpLancedbClientMiddleware[]
private readonly _timeout: number | undefined
public constructor (
url: string,
apiKey: string,
timeout?: number,
private readonly _dbName?: string,
private readonly _dbName?: string
) {
this._url = url
this._apiKey = () => apiKey
this._middlewares = []
this._timeout = timeout
}
get uri (): string {
@@ -235,10 +230,7 @@ export class HttpLancedbClient {
let response
try {
response = await callWithMiddlewares(req, this._middlewares, {
responseType,
timeout: this._timeout,
})
response = await callWithMiddlewares(req, this._middlewares, { responseType })
// return response
} catch (err: any) {
@@ -275,7 +267,7 @@ export class HttpLancedbClient {
* Make a clone of this client
*/
private clone (): HttpLancedbClient {
const clone = new HttpLancedbClient(this._url, this._apiKey(), this._timeout, this._dbName)
const clone = new HttpLancedbClient(this._url, this._apiKey(), this._dbName)
for (const mw of this._middlewares) {
clone._middlewares.push(mw)
}

View File

@@ -72,7 +72,6 @@ export class RemoteConnection implements Connection {
this._client = new HttpLancedbClient(
server,
opts.apiKey,
opts.timeout,
opts.hostOverride === undefined ? undefined : this._dbName
)
}

View File

@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "0.10.1"
current_version = "0.10.0"
parse = """(?x)
(?P<major>0|[1-9]\\d*)\\.
(?P<minor>0|[1-9]\\d*)\\.

View File

@@ -1,6 +1,6 @@
[package]
name = "lancedb-python"
version = "0.10.1"
version = "0.10.0"
edition.workspace = true
description = "Python bindings for LanceDB"
license.workspace = true