v0.31.0 - LazyFrame and GAS-First Design Patterns (2026-03-22)¶
What Changed?¶
This release introduces LazyFrame, a lazy evaluation wrapper around DataFrame that queues operations and executes them only when collect() is called.
It also establishes the GAS-First Argument Design Pattern as an official design guideline, and fixes Expression to follow the centralized GAS global namespace registration pattern.
What's New¶
Main Feature: LazyFrame¶
What it does:
LazyFrame allows you to chain filter, select, and withColumn operations without executing them immediately.
All operations are applied in order when collect() is called, returning a new DataFrame.
How to use it:
TypeScript
// Using a plain function
const result = LazyFrame.from(df)
.filter((row) => (row.get('age') as number) > 18)
.select(['name', 'age'])
.collect();
// Using Expression.toFunction()
const result = LazyFrame.from(df)
.filter(new Expression('age').gt(18).toFunction())
.select(['name', 'age'])
.collect();
Notes:
LazyFrame.from(df)is the only public entry point — the constructor is private.withColumnis queued but not yet executed incollect(). Requires Series integration.LazyFrameaccepts plain functions (FilterFn,MapFn) rather thanExpressiondirectly, following the GAS-First Argument Design Pattern.
Added¶
LazyFrameclass insrc/torch/lazyframe/— lazy evaluation wrapper aroundDataFrameLazyFrame.from(df, options?)— static factory, the only public entry pointLazyFrame.filter(fn)— queue a filter operation using a predicate functionLazyFrame.select(cols)— queue a column selection operationLazyFrame.withColumn(name, fn)— queue a column add/replace operation (stub)LazyFrame.collect()— execute all queued operations and return aDataFrameLazyFrameregistered in GAS global namespace viasrc/index.tsExpressionregistered in GAS global namespace viasrc/index.ts(was missing)- GAS-First Argument Design Pattern documented in
docs/dev/patterns.md
Changed¶
LazyFramemoved fromsrc/torch/dataframe/lazy/tosrc/torch/lazyframe/— it is a wrapper aroundDataFrame, not a part of itLazyFrame.filter()andLazyFrame.withColumn()now accept plain JS functions instead ofExpressionobjectssrc/torch/index.tsupdated: removed duplicatedataframe/patternsexport, fixedExpressionexample API
Fixed¶
Expression: removed non-compliantdeclare const globalThis: anypattern; registration moved tosrc/index.ts
Is It Safe to Upgrade?¶
- Breaking Changes: Yes
-
Backward Compatible: No
-
LazyFrame.filter()previously acceptedExpression; it now accepts(row: Map<string, unknown>) => boolean. Replaceexprwithexpr.toFunction()at call sites. LazyFrame.withColumn()previously acceptedExpression; it now accepts(value: unknown) => unknown.
Release Details¶
- Date: 2026-03-22
- Version: v0.31.0
- gaslamp: version 74
- pilotlamp: version 31
- Files Changed: 131
- Commits:
- e77e83d feat(gas): register LazyFrame in GAS global namespace
- c573402 refactor(torch): move LazyFrame to src/torch/lazyframe/
- c8fb30a refactor(lazy): replace Expression with function types in filter and withColumn
- ae0ac36 feat(lazy): implement collect() with filter and select operations
- f69f036 feat(lazy): add private constructor with source DataFrame
- 106a2aa fix(expression): move globalThis registration to src/index.ts
- 7f9e0e2 docs(patterns): add GAS-First Argument Design Pattern section
Known Issues¶
withColumnis queued but not executed incollect(). Requires Series integration.DataFrame.join()only supports a single join column. Multi-column joins are not yet supported.fromCSV()andfromJSON()are not yet implemented.transpose()is not yet implemented.
Next Steps¶
- Implement
withColumninLazyFrame.collect()via Series integration - Multi-column join support
- Expand test coverage for
LazyFrameoperations