diff --git a/cpp/perspective/src/cpp/view.cpp b/cpp/perspective/src/cpp/view.cpp index dff171a6f4..8aa24ec355 100644 --- a/cpp/perspective/src/cpp/view.cpp +++ b/cpp/perspective/src/cpp/view.cpp @@ -293,9 +293,8 @@ View::get_data( row_path.set("__ROW_PATH__"); cols.insert(cols.begin(), std::vector{row_path}); auto slice_ptr = std::make_shared>(slice); - auto data_slice_ptr - = std::make_shared>(m_ctx, start_row, end_row, start_col, end_col, - m_row_offset, m_col_offset, slice_ptr, cols, column_indices); + auto data_slice_ptr = std::make_shared>(m_ctx, start_row, end_row, + start_col, end_col, m_row_offset, m_col_offset, slice_ptr, cols, column_indices); return data_slice_ptr; } diff --git a/packages/perspective/test/js/pivots.js b/packages/perspective/test/js/pivots.js index ac4db89db5..9fa7f49cec 100644 --- a/packages/perspective/test/js/pivots.js +++ b/packages/perspective/test/js/pivots.js @@ -24,6 +24,13 @@ var data_7 = { z: [true, false, true, false] }; +var data_8 = { + w: [1.5, 2.5, 3.5, 4.5], + x: [1, 2, 3, 4], + y: ["a", "b", "c", "d"], + z: [new Date(1555126035065), new Date(1555126035065), new Date(1555026035065), new Date(1555026035065)] +}; + module.exports = perspective => { describe("Aggregate", function() { it("['z'], sum", async function() { @@ -516,6 +523,23 @@ module.exports = perspective => { table.delete(); }); + it("['z'] only, datetime column", async function() { + var table = perspective.table(data_8); + var view = table.view({ + column_pivots: ["z"], + columns: ["x", "y"] + }); + let result2 = await view.to_columns(); + expect(result2).toEqual({ + "2019-4-11 23:40:35|x": [null, null, 3, 4], + "2019-4-11 23:40:35|y": [null, null, "c", "d"], + "2019-4-13 03:27:15|x": [1, 2, null, null], + "2019-4-13 03:27:15|y": ["a", "b", null, null] + }); + view.delete(); + table.delete(); + }); + it("['x'] only, column-oriented input", async function() { var table = perspective.table(data_7); var view = table.view({