@lancedb/lancedb 0.38.0-beta.0 → 0.38.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/table.js CHANGED
@@ -51,8 +51,9 @@ class LocalTable extends Table {
51
51
  display() {
52
52
  return this.inner.display();
53
53
  }
54
- async getEmbeddingFunctions() {
55
- const schema = await this.schema();
54
+ async getEmbeddingFunctions(inner = this.inner) {
55
+ const schemaBuf = await inner.schema();
56
+ const schema = (0, arrow_1.tableFromIPC)(schemaBuf).schema;
56
57
  const registry = (0, registry_1.getRegistry)();
57
58
  return registry.parseFunctions(schema.metadata);
58
59
  }
@@ -193,12 +194,24 @@ class LocalTable extends Table {
193
194
  columns: ftsColumns,
194
195
  });
195
196
  }
196
- // The query type is auto or vector
197
- // fall back to full text search if no embedding functions are defined and the query is a string
198
- if (queryType === "auto" &&
199
- ((0, registry_1.getRegistry)().length() === 0 || (0, query_1.instanceOfFullTextQuery)(query))) {
200
- return this.query().fullTextSearch(query, {
201
- columns: ftsColumns,
197
+ if (queryType === "auto") {
198
+ if ((0, query_1.instanceOfFullTextQuery)(query)) {
199
+ return this.query().fullTextSearch(query, {
200
+ columns: ftsColumns,
201
+ });
202
+ }
203
+ const columns = typeof ftsColumns === "string" ? [ftsColumns] : (ftsColumns ?? null);
204
+ return (0, query_1.createAutoQuery)(this.inner, query, columns, async (metadata) => {
205
+ const functions = await (0, registry_1.getRegistry)().parseFunctions(new Map([["embedding_functions", metadata]]));
206
+ // TODO: Support multiple embedding functions
207
+ const embeddingFunc = functions
208
+ .values()
209
+ .next().value;
210
+ // The route only calls this callback when embedding metadata exists.
211
+ // parseFunctions either yields a provider or reports malformed metadata.
212
+ if (!embeddingFunc)
213
+ throw new Error("Invalid embedding function metadata");
214
+ return await embeddingFunc.function.computeQueryEmbeddings(query);
202
215
  });
203
216
  }
204
217
  const queryPromise = this.getEmbeddingFunctions().then(async (functions) => {
@@ -225,6 +238,12 @@ class LocalTable extends Table {
225
238
  }
226
239
  // TODO: Support BatchUDF
227
240
  async addColumns(newColumnTransforms) {
241
+ // Columns defined by an expression are declared, not materialized here.
242
+ if (typeof newColumnTransforms === "object" &&
243
+ !Array.isArray(newColumnTransforms) &&
244
+ "computed" in newColumnTransforms) {
245
+ return await this.inner.addComputedColumns(newColumnTransforms.computed);
246
+ }
228
247
  // Handle single Field -> convert to array of Fields
229
248
  if (newColumnTransforms instanceof arrow_1.Field) {
230
249
  newColumnTransforms = [newColumnTransforms];
@@ -250,6 +269,15 @@ class LocalTable extends Table {
250
269
  }
251
270
  throw new Error("Invalid input type for addColumns");
252
271
  }
272
+ async refreshColumn(column) {
273
+ return await this.inner.refreshColumn(column);
274
+ }
275
+ async refreshColumnAsync(column) {
276
+ return await this.inner.refreshColumnAsync(column);
277
+ }
278
+ async refreshMaterializedView(full, sourceVersion) {
279
+ return await this.inner.refreshMaterializedView(full, sourceVersion);
280
+ }
253
281
  async alterColumns(columnAlterations) {
254
282
  const processedAlterations = columnAlterations.map((alteration) => {
255
283
  if (typeof alteration.dataType === "string") {
@@ -299,6 +327,18 @@ class LocalTable extends Table {
299
327
  async closeLsmWriters() {
300
328
  return await this.inner.closeLsmWriters();
301
329
  }
330
+ async flushLsm() {
331
+ return await this.inner.flushLsm();
332
+ }
333
+ async compactLsm() {
334
+ return await this.inner.compactLsm();
335
+ }
336
+ async checkpointLsm() {
337
+ return await this.inner.checkpointLsm();
338
+ }
339
+ async getLsmStats(includeGenerationRows = false) {
340
+ return (await this.inner.getLsmStats(includeGenerationRows)) ?? undefined;
341
+ }
302
342
  async version() {
303
343
  return await this.inner.version();
304
344
  }
@@ -443,16 +483,16 @@ class Branches {
443
483
  return (await this.#inner.diff(fromBranch));
444
484
  }
445
485
  /**
446
- * Merge a branch into main.
486
+ * Cherry-pick a branch onto main.
447
487
  *
448
- * Set `dryRun` to `true` to preview the merge. A rejected merge resolves
449
- * with `status: "rejected"` instead of throwing.
488
+ * Set `dryRun` to `true` to preview. A failed cherry-pick resolves
489
+ * with `status: "failed"` instead of throwing.
450
490
  *
451
- * @param fromBranch Branch to merge from.
452
- * @param dryRun When true, only preview the merge. Defaults to false.
491
+ * @param fromBranch Branch to cherry-pick from.
492
+ * @param dryRun When true, only preview. Defaults to false.
453
493
  */
454
- async merge(fromBranch, dryRun = false) {
455
- return (await this.#inner.merge(fromBranch, dryRun));
494
+ async cherryPick(fromBranch, dryRun = false) {
495
+ return (await this.#inner.cherryPick(fromBranch, dryRun));
456
496
  }
457
497
  }
458
498
  exports.Branches = Branches;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "ann"
12
12
  ],
13
13
  "private": false,
14
- "version": "0.38.0-beta.0",
14
+ "version": "0.38.0-beta.13",
15
15
  "main": "dist/index.js",
16
16
  "exports": {
17
17
  ".": "./dist/index.js",
@@ -67,7 +67,7 @@
67
67
  "timeout": "3m"
68
68
  },
69
69
  "engines": {
70
- "node": ">= 18"
70
+ "node": ">= 22"
71
71
  },
72
72
  "packageManager": "pnpm@11.1.1",
73
73
  "cpu": [
@@ -106,16 +106,16 @@
106
106
  "optionalDependencies": {
107
107
  "@huggingface/transformers": "3.0.2",
108
108
  "openai": "4.29.2",
109
- "@lancedb/lancedb-darwin-arm64": "0.38.0-beta.0",
110
- "@lancedb/lancedb-linux-x64-gnu": "0.38.0-beta.0",
111
- "@lancedb/lancedb-linux-arm64-gnu": "0.38.0-beta.0",
112
- "@lancedb/lancedb-linux-x64-musl": "0.38.0-beta.0",
113
- "@lancedb/lancedb-linux-arm64-musl": "0.38.0-beta.0",
114
- "@lancedb/lancedb-win32-x64-msvc": "0.38.0-beta.0",
115
- "@lancedb/lancedb-win32-arm64-msvc": "0.38.0-beta.0"
109
+ "@lancedb/lancedb-darwin-arm64": "0.38.0-beta.13",
110
+ "@lancedb/lancedb-linux-x64-gnu": "0.38.0-beta.13",
111
+ "@lancedb/lancedb-linux-arm64-gnu": "0.38.0-beta.13",
112
+ "@lancedb/lancedb-linux-x64-musl": "0.38.0-beta.13",
113
+ "@lancedb/lancedb-linux-arm64-musl": "0.38.0-beta.13",
114
+ "@lancedb/lancedb-win32-x64-msvc": "0.38.0-beta.13",
115
+ "@lancedb/lancedb-win32-arm64-msvc": "0.38.0-beta.13"
116
116
  },
117
117
  "peerDependencies": {
118
- "@types/node": ">=18",
118
+ "@types/node": ">=22",
119
119
  "apache-arrow": ">=15.0.0 <=18.1.0"
120
120
  },
121
121
  "peerDependenciesMeta": {