mirror of
https://github.com/lancedb/lancedb.git
synced 2025-12-23 05:19:58 +00:00
docs: nodejs failing CI is fixed (#2802)
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.
This commit is contained in:
@@ -34,7 +34,7 @@ const results = await table.vectorSearch([0.1, 0.3]).limit(20).toArray();
|
|||||||
console.log(results);
|
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
|
## Development
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ A new PermutationBuilder instance
|
|||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
builder.splitCalculated("user_id % 3");
|
builder.splitCalculated({ calculation: "user_id % 3" });
|
||||||
```
|
```
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ export class PermutationBuilder {
|
|||||||
* @returns A new PermutationBuilder instance
|
* @returns A new PermutationBuilder instance
|
||||||
* @example
|
* @example
|
||||||
* ```ts
|
* ```ts
|
||||||
* builder.splitCalculated("user_id % 3");
|
* builder.splitCalculated({ calculation: "user_id % 3" });
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
splitCalculated(options: SplitCalculatedOptions): PermutationBuilder {
|
splitCalculated(options: SplitCalculatedOptions): PermutationBuilder {
|
||||||
|
|||||||
Reference in New Issue
Block a user