Skip to content

Commit

Permalink
Remove index and rows as arguments to the derive expression (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
annie authored May 17, 2023
1 parent 8fecb62 commit 1877389
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -686,10 +686,11 @@ export function __table(source, operations) {
// applied, because operations like filter and sort reference original
// column names.
// TODO Allow derived columns to reference other derived columns.
applyNames(source, operations).map((row, index, rows) => {
applyNames(source, operations).map((row, index) => {
let resolved;
try {
resolved = value(row, index, rows);
// TODO Support referencing `index` and `rows` in the derive function.
resolved = value(row);
} catch (error) {
columnErrors.push({index, error});
resolved = undefined;
Expand Down

0 comments on commit 1877389

Please sign in to comment.