Skip to content

Commit

Permalink
fix issue caused by appending to initialized column, rather than sett…
Browse files Browse the repository at this point in the history
…ing values (jtablesaw#873)
  • Loading branch information
lwhite1 authored Jan 25, 2021
1 parent 390b56d commit 30cc5c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/tech/tablesaw/api/BooleanColumn.java
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ public DoubleColumn asDoubleColumn() {
DoubleColumn numberColumn = DoubleColumn.create(this.name(), size());
ByteArrayList data = data();
for (int i = 0; i < size(); i++) {
numberColumn.append(data.getByte(i));
numberColumn.set(i, data.getByte(i));
}
return numberColumn;
}
Expand Down
6 changes: 6 additions & 0 deletions core/src/test/java/tech/tablesaw/api/BooleanColumnTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public void testAll() {
assertTrue(filtered.all());
}

@Test
public void asDoubleColumn() {
DoubleColumn doubleColumn = column.asDoubleColumn();
assertEquals(column.size(), doubleColumn.size());
}

@Test
public void inRange() {
assertFalse(column.all());
Expand Down

0 comments on commit 30cc5c7

Please sign in to comment.