v0.32.0 - DataFrame Refactoring Foundation (2026-03-22)¶
What Changed?¶
This release introduces two new modules as the foundation for a zero-based DataFrame refactoring.
convert.ts centralizes conversion logic as pure functions, and frame.ts implements an immutable DataFrame that fully delegates to those conversion functions.
No changes were made to the existing dataframe/ module, so backward compatibility is fully preserved.
What's New¶
Main Feature: convert.ts — Pure Conversion Functions¶
What it does:
Provides 6 pure bidirectional conversion functions and two type aliases (Primitive / Cell) covering three data orientations: column-oriented, row-oriented, and array-oriented.
Has no dependency on flamewright or afterglow, and works in both GAS and Node.js environments.
How to use it:
import { columnsToMap, mapToRows, arraysToMap } from "gaslamp";
// Record → Map (column-oriented)
const map = columnsToMap({ name: ["Alice", "Bob"], age: [25, 30] });
// Map → row array (row-oriented)
const rows = mapToRows(map);
rows[0].get("name"); // "Alice"
// 2D array → Map (array-oriented; caller resolves headers)
const data = arraysToMap([["Alice", 25], ["Bob", 30]], ["name", "age"]);
Main Feature: frame.ts — New DataFrame Implementation¶
What it does:
An immutable DataFrame class backed by Map<string, Cell[]>.
All conversion logic is delegated to convert.ts — zero duplicate implementation inside the class itself.
How to use it:
import { DataFrame } from "../../src/torch/frame";
const df = DataFrame.fromColumns({ name: ["Alice", "Bob"], age: [25, 30] });
// Method chaining
const result = df
.filter((row) => (row.get("age") as number) >= 18)
.withColumn("senior", (row) => (row.get("age") as number) >= 65)
.rename({ name: "fullName" });
result.headers; // ["fullName", "age", "senior"]
result.shape; // [2, 3]
Added¶
src/torch/convert.ts—Primitive/Celltype aliases and 6 pure conversion functionscolumnsToMap/mapToColumns(column-oriented)rowsToMap/mapToRows(row-oriented)arraysToMap/mapToArrays(array-oriented)src/torch/frame.ts— Immutable new DataFrame implementation- Input:
fromArrays/fromRows/fromColumns/fromMap - Transform:
select/drop/filter/withColumn/rename - Output:
toArrays/toRows/toColumns - Properties:
headers/length/shape __tests__/torch/convert.test.ts— Unit tests for convert.ts (23 cases)__tests__/torch/frame.test.ts— Unit tests for frame.ts (43 cases)
Changed¶
src/torch/index.ts— Addedconvert.tsto re-exports
Is It Safe to Upgrade?¶
- Breaking Changes: No
- Backward Compatible: Yes
No changes were made to the existing dataframe/ module.
frame.ts is not yet re-exported from index.ts due to a name conflict with the existing DataFrame class, so there is zero impact on existing code.
The Primitive / Cell types and 6 functions from convert.ts are publicly available via index.ts.
Release Details¶
- Date: 2026-03-22
- Version: v0.32.0
- gaslamp: version 75
- pilotlamp: version 32
- Files Changed: 13
- Commits:
d82f3e2feat(torch): add convert.ts with Primitive/Cell types and 6 pure conversion functionsbf74c91test(torch): add unit tests for convert.ts (23 cases)78d1eeefeat(torch): add minimal DataFrame (frame.ts) backed by Map581846atest(torch): add unit tests for frame.ts (43 cases)ced0540bump: version 0.31.0 → 0.32.0
Known Issues¶
frame.ts'sDataFrameclass is not yet re-exported fromsrc/torch/index.tsdue to a name conflict with the existingdataframe/module. Import directly from../../src/torch/frameuntil the replacement is complete.
Next Steps¶
- Add
sort/head/tail/slicetoframe.ts - Gradually replace the existing
dataframe/module withframe.ts - Resolve the name conflict to enable re-export from
index.ts