Upgrade lance and pass AWS creds when opening a table (#426)

This commit is contained in:
Rob Meng
2023-08-14 18:22:02 -04:00
committed by GitHub
parent b281c5255c
commit f0bcb26f32
2 changed files with 11 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ members = [
resolver = "2"
[workspace.dependencies]
lance = "=0.6.1"
lance = "=0.6.2"
arrow-array = "43.0"
arrow-data = "43.0"
arrow-schema = "43.0"
@@ -14,4 +14,3 @@ arrow-ipc = "43.0"
half = { "version" = "=2.2.1", default-features = false }
object_store = "0.6.1"
snafu = "0.7.4"

View File

@@ -256,7 +256,16 @@ export class LocalConnection implements Connection {
async openTable<T> (name: string, embeddings: EmbeddingFunction<T>): Promise<Table<T>>
async openTable<T> (name: string, embeddings?: EmbeddingFunction<T>): Promise<Table<T>>
async openTable<T> (name: string, embeddings?: EmbeddingFunction<T>): Promise<Table<T>> {
const tbl = await databaseOpenTable.call(this._db, name)
// TODO: move this thing into rust
const callArgs = [this._db, name]
if (this._options.awsCredentials !== undefined) {
callArgs.push(this._options.awsCredentials.accessKeyId)
callArgs.push(this._options.awsCredentials.secretKey)
if (this._options.awsCredentials.sessionToken !== undefined) {
callArgs.push(this._options.awsCredentials.sessionToken)
}
}
const tbl = await databaseOpenTable.call(...callArgs)
if (embeddings !== undefined) {
return new LocalTable(tbl, name, this._options, embeddings)
} else {