From 72517dd0f6a9af0376e9da1211dc3aebc0bf8ed0 Mon Sep 17 00:00:00 2001 From: Brendan Clement Date: Mon, 5 Oct 2026 14:07:59 -0700 Subject: [PATCH] docs: build the progress message from template literals Biome's useTemplate rule flagged the restored example's string concatenation. The message it logs is unchanged. --- docs/web-tests/ts/tables.test.ts | 12 +++++------- docs/web/snippets/tables.mdx | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/web-tests/ts/tables.test.ts b/docs/web-tests/ts/tables.test.ts index ec6360008..16fa4545c 100644 --- a/docs/web-tests/ts/tables.test.ts +++ b/docs/web-tests/ts/tables.test.ts @@ -210,13 +210,11 @@ test("add progress snippet (async)", async () => { // Track ingestion progress as batches are written. await table.add(moreData, { progress: (p) => { - const total = p.totalRows ?? "?"; - console.log( - `wrote ${p.outputRows}/${total} rows ` + - `(${p.outputBytes} bytes, ${p.elapsedSeconds.toFixed(1)}s, ` + - `${p.activeTasks}/${p.totalTasks} tasks active)` + - (p.done ? " \u2014 done" : ""), - ); + const rows = `${p.outputRows}/${p.totalRows ?? "?"} rows`; + const size = `${p.outputBytes} bytes, ${p.elapsedSeconds.toFixed(1)}s`; + const tasks = `${p.activeTasks}/${p.totalTasks} tasks active`; + const done = p.done ? " \u2014 done" : ""; + console.log(`wrote ${rows} (${size}, ${tasks})${done}`); }, }); // --8<-- [end:add_progress] diff --git a/docs/web/snippets/tables.mdx b/docs/web/snippets/tables.mdx index 88b33fe8a..6b9b98280 100644 --- a/docs/web/snippets/tables.mdx +++ b/docs/web/snippets/tables.mdx @@ -148,7 +148,7 @@ 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 TsAddProgress = "// Track ingestion progress as batches are written.\nawait table.add(moreData, {\n progress: (p) => {\n const rows = `${p.outputRows}/${p.totalRows ?? \"?\"} rows`;\n const size = `${p.outputBytes} bytes, ${p.elapsedSeconds.toFixed(1)}s`;\n const tasks = `${p.activeTasks}/${p.totalTasks} tasks active`;\n const done = p.done ? \" \\u2014 done\" : \"\";\n console.log(`wrote ${rows} (${size}, ${tasks})${done}`);\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";