From 76bcc78910ac5661e3d4fee11b770d4f3f87e847 Mon Sep 17 00:00:00 2001 From: Prashanth Rao <35005448+prrao87@users.noreply.github.com> Date: Thu, 20 Nov 2025 16:16:38 -0800 Subject: [PATCH] docs: nodejs failing CI is fixed (#2802) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the breaking CI for nodejs, related to the documentation of the new Permutation API in typescript. - Expanded the generated typings in `nodejs/lancedb/native.d.ts` to include `SplitCalculatedOptions`, `splitNames` fields, and the persist/options-based `splitCalculated` methods so the permutation exports match the native API. - The previous block comment block had an inconsistency. `splitCalculated` takes an options object (`SplitCalculatedOptions`) in our bindings, not a bare string. The previous example showed `builder.splitCalculated("user_id % 3");`, which doesn’t match the actual signature and would fail TS typecheck. I updated the comment to `builder.splitCalculated({ calculation: "user_id % 3" });` so the example is now correct. - Updated the `splitCalculated` example in `nodejs/lancedb/permutation.ts` to use the options object. - Ran `npm docs` to ensure docs build correctly. > [!NOTE] > **Disclaimer**: I used GPT-5.1-Codex-Max to make these updates, but I have read the code and run `npm run docs` to verify that they work and are correct to the best of my knowledge. --- docs/src/js/README.md | 2 +- docs/src/js/classes/PermutationBuilder.md | 2 +- nodejs/lancedb/permutation.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/src/js/README.md b/docs/src/js/README.md index 1a00de46..3b01438d 100644 --- a/docs/src/js/README.md +++ b/docs/src/js/README.md @@ -34,7 +34,7 @@ const results = await table.vectorSearch([0.1, 0.3]).limit(20).toArray(); console.log(results); ``` -The [quickstart](https://lancedb.com/docs/quickstart/basic-usage/) contains a more complete example. +The [quickstart](https://lancedb.com/docs/quickstart/basic-usage/) contains more complete examples. ## Development diff --git a/docs/src/js/classes/PermutationBuilder.md b/docs/src/js/classes/PermutationBuilder.md index b293929b..6988bf42 100644 --- a/docs/src/js/classes/PermutationBuilder.md +++ b/docs/src/js/classes/PermutationBuilder.md @@ -147,7 +147,7 @@ A new PermutationBuilder instance #### Example ```ts -builder.splitCalculated("user_id % 3"); +builder.splitCalculated({ calculation: "user_id % 3" }); ``` *** diff --git a/nodejs/lancedb/permutation.ts b/nodejs/lancedb/permutation.ts index ce1c73c5..e55b6855 100644 --- a/nodejs/lancedb/permutation.ts +++ b/nodejs/lancedb/permutation.ts @@ -118,7 +118,7 @@ export class PermutationBuilder { * @returns A new PermutationBuilder instance * @example * ```ts - * builder.splitCalculated("user_id % 3"); + * builder.splitCalculated({ calculation: "user_id % 3" }); * ``` */ splitCalculated(options: SplitCalculatedOptions): PermutationBuilder {