Skip to content

Commit

Permalink
Test transform when no Python wheel tasks defined (#714)
Browse files Browse the repository at this point in the history
## Changes
Fixed panic from Python transform when no python wheel tasks defined

## Tests
Added regression test
  • Loading branch information
andrewnester authored and lennartkats-db committed Sep 1, 2023
1 parent 3f14aee commit 1576323
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions bundle/python/transform_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package python

import (
"context"
"strings"
"testing"

Expand Down Expand Up @@ -99,3 +100,34 @@ func TestTransformFiltersWheelTasksOnly(t *testing.T) {
require.Equal(t, "key1", tasks[0].Task.TaskKey)
require.NotNil(t, tasks[0].Task.PythonWheelTask)
}

func TestNoPanicWithNoPythonWheelTasks(t *testing.T) {
tmpDir := t.TempDir()
b := &bundle.Bundle{
Config: config.Root{
Path: tmpDir,
Bundle: config.Bundle{
Target: "development",
},
Resources: config.Resources{
Jobs: map[string]*resources.Job{
"test": {
Paths: resources.Paths{
ConfigFilePath: tmpDir,
},
JobSettings: &jobs.JobSettings{
Tasks: []jobs.Task{
{
TaskKey: "notebook_task",
NotebookTask: &jobs.NotebookTask{}},
},
},
},
},
},
},
}
trampoline := TransformWheelTask()
err := bundle.Apply(context.Background(), b, trampoline)
require.NoError(t, err)
}

0 comments on commit 1576323

Please sign in to comment.