Skip to content

Commit

Permalink
fix(empty body): remove empty body array assumption
Browse files Browse the repository at this point in the history
  • Loading branch information
b5 committed Nov 9, 2018
1 parent cb6ae15 commit de5d458
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,6 @@ func ExecScript(ds *dataset.Dataset, script, bodyFile cafs.File, opts ...func(o
return nil, err
}

// set infile to be an empty array for now
// TODO - this default assumption may mess with things. we shoulda attempt to
// infer more from the input dataset & make smarter assumption about empty data
// this implies that all datasets must have a body, which isn't true :/
t.infile = cafs.NewMemfileBytes("data.json", []byte("[]"))

funcs, err := t.specialFuncs()
if err != nil {
return nil, err
Expand Down Expand Up @@ -237,7 +231,7 @@ func callTransformFunc(t *transform, thread *starlark.Thread, ctx *skyctx.Contex
}
return err
}
t.print("⚙️ running transform...\n")
t.print("🤖 running transform...\n")

d := skyds.NewDataset(t.ds, t.infile, t.checkFunc)
if _, err = starlark.Call(thread, transform, starlark.Tuple{d.Methods(), ctx.Struct()}, nil); err != nil {
Expand Down

0 comments on commit de5d458

Please sign in to comment.