Skip to content

Commit

Permalink
Add arrow test for null data
Browse files Browse the repository at this point in the history
  • Loading branch information
nmichaud committed Feb 2, 2018
1 parent 6926d11 commit 83751ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Binary file added packages/perspective/test/arrow/test-null.arrow
Binary file not shown.
6 changes: 3 additions & 3 deletions packages/perspective/test/js/constructors.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ var meta_3 = {
'z': "boolean"
};

import arrow_buffer from "../arrow/test.arrow";
import arrow from "../arrow/test-null.arrow";

var arrow_result = [
{"f32": 1.5, "f64": 1.5, "i64": 1, "i32": 1, "i16": 1, "i8": 1, "bool": true, "char": "a", "dict": "a", "datetime": +(new Date("2018-01-25"))},
{"f32": 2.5, "f64": 2.5, "i64": 2, "i32": 2, "i16": 2, "i8": 2, "bool": false, "char": "b", "dict": "b", "datetime": +(new Date("2018-01-26"))},
{"f32": 3.5, "f64": 3.5, "i64": 3, "i32": 3, "i16": 3, "i8": 3, "bool": true, "char": "c", "dict": "c", "datetime": +(new Date("2018-01-27"))},
{"f32": 4.5, "f64": 4.5, "i64": 4, "i32": 4, "i16": 4, "i8": 4, "bool": false, "char": "d", "dict": "d", "datetime": +(new Date("2018-01-28"))},
{"f32": 5.5, "f64": 5.5, "i64": 5, "i32": 5, "i16": 5, "i8": 5, "bool": true, "char": "d", "dict": "d", "datetime": +(new Date("2018-01-29"))}
{"f32": null, "f64": null, "i64": null, "i32": null, "i16": null, "i8": null, "bool": null, "char": null, "dict": null, "datetime": null}
];

var dt = new Date();
Expand Down Expand Up @@ -107,7 +107,7 @@ module.exports = (perspective) => {
});

it("Arrow constructor", async function () {
var table = perspective.table(arrow_buffer);
var table = perspective.table(arrow);
var view = table.view();
let result = await view.to_json();
expect(arrow_result).toEqual(result);
Expand Down
8 changes: 4 additions & 4 deletions packages/perspective/test/js/pivots.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ module.exports = (perspective) => {
});
var answer = [
{"__ROW_PATH__":[],"a,x":1,"a,y":1,"a,z":1,"b,x":1,"b,y":1,"b,z":1,"c,x":1,"c,y":1,"c,z":1,"d,x":1,"d,y":1,"d,z":1},
{"__ROW_PATH__":[1],"a,x":1,"a,y":1,"a,z":1,"b,x":undefined,"b,y":undefined,"b,z":undefined,"c,x":undefined,"c,y":undefined,"c,z":undefined,"d,x":undefined,"d,y":undefined,"d,z":undefined},
{"__ROW_PATH__":[2],"a,x":undefined,"a,y":undefined,"a,z":undefined,"b,x":1,"b,y":1,"b,z":1,"c,x":undefined,"c,y":undefined,"c,z":undefined,"d,x":undefined,"d,y":undefined,"d,z":undefined},
{"__ROW_PATH__":[3],"a,x":undefined,"a,y":undefined,"a,z":undefined,"b,x":undefined,"b,y":undefined,"b,z":undefined,"c,x":1,"c,y":1,"c,z":1,"d,x":undefined,"d,y":undefined,"d,z":undefined},
{"__ROW_PATH__":[4],"a,x":undefined,"a,y":undefined,"a,z":undefined,"b,x":undefined,"b,y":undefined,"b,z":undefined,"c,x":undefined,"c,y":undefined,"c,z":undefined,"d,x":1,"d,y":1,"d,z":1}
{"__ROW_PATH__":[1],"a,x":1,"a,y":1,"a,z":1,"b,x":null,"b,y":null,"b,z":null,"c,x":null,"c,y":null,"c,z":null,"d,x":null,"d,y":null,"d,z":null},
{"__ROW_PATH__":[2],"a,x":null,"a,y":null,"a,z":null,"b,x":1,"b,y":1,"b,z":1,"c,x":null,"c,y":null,"c,z":null,"d,x":null,"d,y":null,"d,z":null},
{"__ROW_PATH__":[3],"a,x":null,"a,y":null,"a,z":null,"b,x":null,"b,y":null,"b,z":null,"c,x":1,"c,y":1,"c,z":1,"d,x":null,"d,y":null,"d,z":null},
{"__ROW_PATH__":[4],"a,x":null,"a,y":null,"a,z":null,"b,x":null,"b,y":null,"b,z":null,"c,x":null,"c,y":null,"c,z":null,"d,x":1,"d,y":1,"d,z":1}
];
let result2 = await view.to_json();
expect(answer).toEqual(result2);
Expand Down

0 comments on commit 83751ee

Please sign in to comment.