Skip to content

Commit

Permalink
Merge pull request #1887 from finos/expand-collapse-ctx2
Browse files Browse the repository at this point in the history
Fix expand/collapse on first row of ctx2
  • Loading branch information
texodus authored Jul 4, 2022
2 parents 3ba1613 + f7b8dc0 commit 81c4263
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[![npm](https://img.shields.io/npm/v/@finos/perspective.svg?style=flat)](https://www.npmjs.com/package/@finos/perspective)
[![PyPI](https://img.shields.io/pypi/v/perspective-python.svg?style=flat)](https://pypi.python.org/pypi/perspective-python)
[![Build Status](https://github.com/finos/perspective/workflows/Build%20Status/badge.svg?branch=master)](https://github.com/finos/perspective/actions?query=workflow%3A%22Build+Status%22)
[![Build Status](https://github.com/finos/perspective/actions/workflows/build.yml/badge.svg?branch=master&event=push)](https://github.com/finos/perspective/actions/workflows/build.yml)

Perspective is an <i>interactive</i> analytics and data visualization component,
which is especially well-suited for <i>large</i> and/or <i>streaming</i> datasets.
Expand Down
2 changes: 1 addition & 1 deletion cpp/perspective/src/cpp/traversal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ t_traversal::drop_tree_indices(const std::vector<t_uindex>& indices) {

bool
t_traversal::is_valid_idx(t_index idx) const {
return idx > 0 && idx < t_index(size());
return idx >= 0 && idx < t_index(size());
}

const t_stree*
Expand Down
7 changes: 5 additions & 2 deletions python/perspective/perspective/tests/table/test_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from perspective import PerspectiveCppError
from perspective.table import Table
from datetime import date, datetime
from pytest import approx, mark, raises
from pytest import approx, mark, raises, skip


def compare_delta(received, expected):
Expand Down Expand Up @@ -2036,8 +2036,11 @@ def test_view_collapse_two(self):
data = [{"a": 1, "b": 2, "c": "a"}, {"a": 3, "b": 4, "c": "b"}]
tbl = Table(data)
view = tbl.view(group_by=["a"], split_by=["c"])
assert view.collapse(0) == 0
assert view.collapse(0) == 2

# TODO collapse/espand should be no-ops on column only contexts, but
# the concept of "column only" is not yet implemented in C++
@skip
def test_view_collapse_two_column_only(self):
data = [{"a": 1, "b": 2, "c": "a"}, {"a": 3, "b": 4, "c": "b"}]
tbl = Table(data)
Expand Down

0 comments on commit 81c4263

Please sign in to comment.