Skip to content

Commit

Permalink
push only valid values to resiliencyData
Browse files Browse the repository at this point in the history
  • Loading branch information
Arpit Narechania authored and Arpit Narechania committed Sep 10, 2023
1 parent 0b216d8 commit f69722e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1002,14 +1002,16 @@ export class BinGuru {
let resiliencyData: object[] = [];
Object.keys(frequencyOfMostFrequentBins).forEach(function (primaryKey, valindex) {
let obj: any = {};
obj["primaryKey"] = primaryKey;
obj["value"] = context.rawData[valindex];
obj["binCandidates"] = [];

Object.keys(binningMethodObjs).forEach(function (binningMethod) {
obj["binCandidates"].push(JSON.parse(JSON.stringify(binningMethodObjs[binningMethod]["dataBinAssignments"][primaryKey])));
});
resiliencyData.push(obj);
if(context.isValid(context.rawData[valindex])){
obj["primaryKey"] = primaryKey;
obj["value"] = context.rawData[valindex];
obj["binCandidates"] = [];

Object.keys(binningMethodObjs).forEach(function (binningMethod) {
obj["binCandidates"].push(JSON.parse(JSON.stringify(binningMethodObjs[binningMethod]["dataBinAssignments"][primaryKey])));
});
resiliencyData.push(obj);
}
});

let itemwiseBinPriorities: any = {};
Expand Down

0 comments on commit f69722e

Please sign in to comment.