mirror of
https://github.com/lancedb/lancedb.git
synced 2026-10-19 10:12:28 +00:00
docs: fix the two snippet imports Mint cannot resolve
Two pages imported PySchemaAddSetup under the alias SchemaAddSetup, and Mint resolved only the first, failing `mint validate` on management/table.mdx. Both pages now import it unaliased. TsAddProgress was added to the generated tables snippets by hand in lancedb/docs#243 and dropped by the next regeneration, leaving ingestion/insert.mdx with a missing import. Its example is restored unchanged as a test in docs/web-tests/ts/tables.test.ts, which checks that the callback reports the finished write.
This commit is contained in:
@@ -7,7 +7,7 @@ keywords: ["data evolution", "derived columns", "add_columns", "zero copy", "fea
|
||||
---
|
||||
|
||||
import {
|
||||
PySchemaAddSetup as SchemaAddSetup,
|
||||
PySchemaAddSetup,
|
||||
TsSchemaAddSetup as TsSchemaAddSetup,
|
||||
RsSchemaAddSetup as RsSchemaAddSetup,
|
||||
PyAddColumnsCalculated as AddColumnsCalculated,
|
||||
@@ -34,7 +34,7 @@ In SQL this is [`ALTER TABLE ... ADD COLUMN ... AS`](/sql/ddl/table#computed-col
|
||||
|
||||
<CodeGroup>
|
||||
<CodeBlock filename="Python" language="Python" icon="python">
|
||||
{SchemaAddSetup}
|
||||
{PySchemaAddSetup}
|
||||
</CodeBlock>
|
||||
|
||||
<CodeBlock filename="TypeScript" language="TypeScript" icon="square-js">
|
||||
|
||||
@@ -7,7 +7,7 @@ keywords: ["table", "create_table", "open_table", "clone", "rename", "drop"]
|
||||
---
|
||||
|
||||
import {
|
||||
PySchemaAddSetup as SchemaAddSetup,
|
||||
PySchemaAddSetup,
|
||||
TsSchemaAddSetup as TsSchemaAddSetup,
|
||||
RsSchemaAddSetup as RsSchemaAddSetup,
|
||||
PyAddColumnsDefaultValues as AddColumnsDefaultValues,
|
||||
@@ -534,7 +534,7 @@ First, let's create a sample table with product data to demonstrate schema evolu
|
||||
|
||||
<CodeGroup>
|
||||
<CodeBlock filename="Python" language="Python" icon="python">
|
||||
{SchemaAddSetup}
|
||||
{PySchemaAddSetup}
|
||||
</CodeBlock>
|
||||
|
||||
<CodeBlock filename="TypeScript" language="TypeScript" icon="square-js">
|
||||
|
||||
@@ -148,6 +148,8 @@ export const TsAddColumnsNullable = "// Add a nullable timestamp column\nawait s
|
||||
|
||||
export const TsAddFeatureColumnsSql = "await schemaAddTable.addColumns([\n {\n name: \"price_per_id\",\n valueSql: \"cast(price / id as float)\",\n },\n {\n name: \"price_log\",\n valueSql: \"ln(price)\",\n },\n {\n name: \"price_score\",\n valueSql: \"cast(price / (price + 100.0) as float)\",\n },\n]);\n";
|
||||
|
||||
export const TsAddProgress = "// Track ingestion progress as batches are written.\nawait table.add(moreData, {\n progress: (p) => {\n const total = p.totalRows ?? \"?\";\n console.log(\n `wrote ${p.outputRows}/${total} rows ` +\n `(${p.outputBytes} bytes, ${p.elapsedSeconds.toFixed(1)}s, ` +\n `${p.activeTasks}/${p.totalTasks} tasks active)` +\n (p.done ? \" \\u2014 done\" : \"\"),\n );\n },\n});\n";
|
||||
|
||||
export const TsAlterColumnsDataType = "// Change price from int32 to int64 for larger numbers\nawait schemaAlterTable.alterColumns([\n { path: \"price\", dataType: new arrow.Int64() },\n]);\n";
|
||||
|
||||
export const TsAlterColumnsMultiple = "// Rename, change type, and make nullable in one operation\nawait schemaAlterTable.alterColumns([\n {\n path: \"sale_price\",\n rename: \"final_price\",\n dataType: new arrow.Float64(),\n nullable: true,\n },\n]);\n";
|
||||
|
||||
Reference in New Issue
Block a user