mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
add frame required in action
This commit is contained in:
parent
9fd1de8f29
commit
56c16e923a
2 changed files with 10 additions and 0 deletions
|
|
@ -282,6 +282,9 @@ func (i *InputDefinition) AddFrame(frame InputFrame) error {
|
|||
}
|
||||
|
||||
func (i *InputDefinition) ValidateAction(action *internal.Action) error {
|
||||
if action.Frame == "" {
|
||||
return ErrFrameRequired
|
||||
}
|
||||
validValues := make(map[string]bool)
|
||||
for _, val := range ValidValueDestination {
|
||||
validValues[val] = true
|
||||
|
|
|
|||
|
|
@ -143,4 +143,11 @@ func TestInputDefinition_LoadDefinition(t *testing.T) {
|
|||
if !strings.Contains(err.Error(), "duplicate rowID with other field") {
|
||||
t.Fatalf("Expected duplicate rowID with other field error, actual error: %s", err)
|
||||
}
|
||||
|
||||
action = internal.Action{ValueDestination: "single-row-boolean", RowID: 100}
|
||||
def = &internal.InputDefinition{Name: "test", Frames: []*internal.Frame{&frames}, Fields: []*internal.InputDefinitionField{&field}}
|
||||
err = input.LoadDefinition(def)
|
||||
if !strings.Contains(err.Error(), "frame required") {
|
||||
t.Fatalf("Expected frame required error, actual error: %s", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue