Skip to content

v0.35.0 - DataFrame Expansion for frame.ts (2026-03-22)

What Changed?

This release expands the experimental DataFrame implementation in frame.ts (exported as DataFrameV2) with a full set of transformation, display, and I/O methods. The new methods cover row slicing, sorting, concatenation, inner joins, table display, and Google Sheets integration. All additions follow the same design principle as the existing frame.ts: no dependency on FlameWright or AfterGlow, with full delegation to convert.ts.


What's New

Main Feature: DataFrame method expansion (frame.ts)

What it does: Adds the most commonly needed DataFrame operations to the experimental DataFrameV2 class, bringing it closer to feature parity with the existing DataFrame in dataframe/.

How to use it:

TypeScript
import { DataFrameV2 as DataFrame } from "gaslamp";

const df = DataFrame.fromColumns({
  name: ["Charlie", "Alice", "Bob"],
  age: [35, 25, 30],
});

// Slicing
df.head(2);           // first 2 rows
df.tail(2);           // last 2 rows
df.slice(1, 3);       // rows 1–2

// Sorting
df.sort("age");               // ascending
df.sort("age", false);        // descending

// Concatenation
const df2 = DataFrame.fromColumns({ name: ["Diana"], age: [28] });
df.concat(df2);               // append rows

// Join
const scores = DataFrame.fromColumns({ name: ["Alice", "Bob"], score: [90, 80] });
df.join(scores, "name");      // inner join (default)

// Display
df.toString();        // "DataFrame(3 rows × 2 cols, headers=[name, age])"
df.toTableString();   // markdown-style table
df.display();         // alias for toTableString

// Google Sheets
const sheet = SpreadsheetApp.getActiveSheet();
const dfFromSheet = DataFrame.fromSheet(sheet);
const range = sheet.getRange("A1:B10");
const dfFromRange = DataFrame.fromRange(range);

Added

  • DataFrame.slice(start, end?) — row range selection following Array.prototype.slice semantics
  • DataFrame.head(n=5) — first n rows
  • DataFrame.tail(n=5) — last n rows
  • DataFrame.sort(by, ascending=true) — sort by column; nulls always last
  • DataFrame.concat(other) — vertical concatenation; headers must match in order
  • DataFrame.join(other, on, how="inner") — dispatches to join variants
  • DataFrame.joinInner(other, on) — inner join on a column
  • DataFrame.joinLeft(other, on) — placeholder (not yet implemented)
  • DataFrame.joinRight(other, on) — placeholder (not yet implemented)
  • DataFrame.joinOuter(other, on) — placeholder (not yet implemented)
  • DataFrame.toString() — one-line summary string
  • DataFrame.toTableString(maxRows?, maxColWidth?) — markdown-style table
  • DataFrame.display(maxRows?, maxColWidth?) — alias for toTableString
  • DataFrame.fromRange(range, header=true) — factory from GAS Range
  • DataFrame.fromSheet(sheet, header=true) — factory from GAS Sheet
  • 48 new tests covering all added methods in frame.test.ts

Changed

  • concat implementation now uses direct column array spread instead of toRows/rowsToMap roundtrip (memory efficiency improvement)
  • tail implementation simplified to slice(-n) using native negative index support

Fixed

  • fromRange(range, false): previously discarded the first row instead of treating all rows as data; now generates numeric column names ("0", "1", ...) and passes all rows as data

Is It Safe to Upgrade?

  • Breaking Changes: No
  • Backward Compatible: Yes

All changes are additive. The DataFrameV2 export is marked @alpha and is independent of the stable DataFrame in dataframe/. Existing code is unaffected.


Release Details

  • Date: 2026-03-22
  • Version: v0.35.0
  • gaslamp: version 78
  • pilotlamp: version 35
  • Files Changed: 3 (frame.ts, torch/index.ts, frame.test.ts)
  • Commits:
    • ec10e0f bump: version 0.34.0 → 0.35.0
    • 9d4b9a5 test(torch): add tests for fromRange and fromSheet
    • 766fd2c test(torch): add tests for toString, toTableString, display
    • b66e4d1 test(torch): add tests for concat, joinInner, join
    • 2fab088 test(torch): add tests for sort
    • e507314 test(torch): add tests for slice, head, tail
    • 922e84c fix(torch): fix fromRange when header=false
    • 0be37b9 feat(torch): add fromRange and fromSheet
    • 649da08 feat(torch): add toString, toTableString, display
    • 58e8828 feat(torch): add joinLeft, joinRight, joinOuter placeholders
    • 7cc609f refactor(torch): improve concat implementation
    • ae84f51 feat(torch): add concat, join, and joinInner
    • 240d562 feat(torch): add sort
    • 8e4bfe0 fix(torch): simplify tail to use slice(-n)
    • a100133 feat(torch): add slice, head, tail
    • 690fa7b docs(api): regenerate TypeDoc API reference
    • 66caee4 docs(api): add TypeDoc pages for DataFrameV2 aliases
    • 861dcc1 feat(torch): export frame.ts classes as DataFrameV2 aliases

Known Issues

  • joinLeft, joinRight, joinOuter are placeholders and throw "not yet implemented" when called.
  • DataFrameV2 is @alpha — API may change or be removed without notice.

Next Steps

  • Implement joinLeft, joinRight, joinOuter
  • Evaluate DataFrameV2 as a replacement candidate for the existing DataFrame in dataframe/
  • Add toCSV / toJSON output methods to frame.ts