mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 00:55:55 +00:00
removed float64 check in single row boolean
This commit is contained in:
parent
26469db490
commit
453e5417f8
2 changed files with 6 additions and 16 deletions
|
|
@ -346,12 +346,6 @@ func HandleAction(a Action, value interface{}, colID uint64) (*Bit, error) {
|
|||
} else { // value is not True.
|
||||
return nil, err
|
||||
}
|
||||
case float64:
|
||||
if value.(float64) >= 1 {
|
||||
bit.RowID = *a.RowID
|
||||
} else { // value is not True.
|
||||
return nil, err
|
||||
}
|
||||
default:
|
||||
return nil, fmt.Errorf("single-row-boolean value %v must equate to a Bool", value)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,17 +171,10 @@ func TestHandleAction(t *testing.T) {
|
|||
t.Fatalf("Expected Unrecognized Value Destination error, actual error: %s", err)
|
||||
}
|
||||
|
||||
value = float64(1.5)
|
||||
value = float64(1)
|
||||
b, err = pilosa.HandleAction(action, value, colID)
|
||||
if b != nil {
|
||||
if b.RowID != 100 {
|
||||
t.Fatalf("Unexpected rowID %v", b.RowID)
|
||||
}
|
||||
}
|
||||
value = float64(0)
|
||||
b, err = pilosa.HandleAction(action, value, colID)
|
||||
if b != nil {
|
||||
t.Fatalf("Expected Ignore values that do not equate to True")
|
||||
if !strings.Contains(err.Error(), "must equate to a Bool") {
|
||||
t.Fatalf("Expected Unrecognized Value Destination error, actual error: %s", err)
|
||||
}
|
||||
|
||||
value = false
|
||||
|
|
@ -196,6 +189,9 @@ func TestHandleAction(t *testing.T) {
|
|||
if b.ColumnID != 0 {
|
||||
t.Fatalf("Unexpected ColumnID %v", b.ColumnID)
|
||||
}
|
||||
if b.RowID != 100 {
|
||||
t.Fatalf("Unexpected rowID %v", b.RowID)
|
||||
}
|
||||
}
|
||||
|
||||
action.ValueDestination = pilosa.InputValueToRow
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue