Skip to content

Commit

Permalink
fix non number handling
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Oct 13, 2020
1 parent 950e642 commit e67af0b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const cumulativeSum: ExpressionFunctionCumulativeSum = {
const currentValue = newRow[inputColumnId];
if (currentValue != null) {
newRow[outputColumnId] = Number(currentValue) + accumulatorValue;
accumulators[bucketIdentifier] = currentValue;
accumulators[bucketIdentifier] = newRow[outputColumnId];
} else {
newRow[outputColumnId] = accumulatorValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ describe('interpreter/functions#cumulative_sum', () => {
"val": 7,
},
Object {
"output": 10,
"output": 15,
"val": 3,
},
Object {
"output": 5,
"output": 17,
"val": 2,
},
],
Expand Down Expand Up @@ -147,22 +147,22 @@ describe('interpreter/functions#cumulative_sum', () => {
"val": 4,
},
Object {
"output": 9,
"output": 10,
"split": "A",
"val": 5,
},
Object {
"output": 11,
"output": 16,
"split": "A",
"val": 6,
},
Object {
"output": 10,
"output": 12,
"split": "B",
"val": 7,
},
Object {
"output": 15,
"output": 20,
"split": "B",
"val": 8,
},
Expand Down Expand Up @@ -244,7 +244,7 @@ describe('interpreter/functions#cumulative_sum', () => {
"val": 5,
},
Object {
"output": 10,
"output": 11,
"split": "A",
"val": 6,
},
Expand All @@ -254,7 +254,7 @@ describe('interpreter/functions#cumulative_sum', () => {
"val": 7,
},
Object {
"output": 15,
"output": 17,
"split": "B",
"val": 8,
},
Expand Down Expand Up @@ -337,12 +337,12 @@ describe('interpreter/functions#cumulative_sum', () => {
"val": 5,
},
Object {
"output": 10,
"output": 11,
"split": "A",
"val": 6,
},
Object {
"output": 12,
"output": 15,
"split": null,
"val": 7,
},
Expand All @@ -352,7 +352,7 @@ describe('interpreter/functions#cumulative_sum', () => {
"val": 8,
},
Object {
"output": 16,
"output": 24,
"split": "",
"val": 9,
},
Expand Down Expand Up @@ -581,11 +581,11 @@ describe('interpreter/functions#cumulative_sum', () => {
"val": "7",
},
Object {
"output": "37",
"output": 15,
"val": "3",
},
Object {
"output": "23",
"output": 17,
"val": 2,
},
],
Expand Down Expand Up @@ -632,11 +632,11 @@ describe('interpreter/functions#cumulative_sum', () => {
"val": "7",
},
Object {
"output": "NaN7",
"output": NaN,
"val": Object {},
},
Object {
"output": "2[object Object]",
"output": NaN,
"val": 2,
},
],
Expand Down Expand Up @@ -713,11 +713,11 @@ describe('interpreter/functions#cumulative_sum', () => {
"val": "3",
},
Object {
"output": "23",
"output": 12,
"val": 2,
},
Object {
"output": 2,
"output": 12,
"val": null,
},
],
Expand Down

0 comments on commit e67af0b

Please sign in to comment.