Skip to content

Commit

Permalink
Merge pull request #1320 from finos/fix-ctx0
Browse files Browse the repository at this point in the history
Fix missing return in ctx0::notify
  • Loading branch information
texodus authored Feb 10, 2021
2 parents bd04a01 + fbe1721 commit eeb8b1e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cpp/perspective/src/cpp/context_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ t_ctx0::notify(const t_data_table& flattened, const t_data_table& delta,
add_delta_pkey(pkey);
}
m_has_delta = m_deltas->size() > 0 || m_delta_pkeys.size() > 0 || delete_encountered;

return;
}

// Context does not have filters applied
Expand Down
27 changes: 27 additions & 0 deletions packages/perspective/test/js/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,33 @@ module.exports = perspective => {
table.delete();
});

it("x == 1, rolling updates", async function() {
var table = perspective.table(data);
var view = table.view({
columns: ["x"],
filter: [["x", "==", 1]]
});
let json = await view.to_json();
expect(json).toEqual([{x: 1}]);

for (let i = 0; i < 5; i++) {
table.update([{x: 1}]);
}

expect(await view.to_columns()).toEqual({
x: [1, 1, 1, 1, 1, 1]
});

table.update([{x: 2}]);

expect(await view.to_columns()).toEqual({
x: [1, 1, 1, 1, 1, 1]
});

view.delete();
table.delete();
});

it("x == 5", async function() {
var table = perspective.table(data);
var view = table.view({
Expand Down

0 comments on commit eeb8b1e

Please sign in to comment.