Skip to content

Commit

Permalink
refactor out null transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
evisdrenova committed Nov 3, 2023
1 parent 3e1bb91 commit 6a63186
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 43 deletions.
23 changes: 0 additions & 23 deletions worker/internal/benthos/transformers/null.go

This file was deleted.

19 changes: 0 additions & 19 deletions worker/internal/benthos/transformers/null_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion worker/pkg/workflows/datasync/activities/activities.go
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ func computeMutationFunction(col *mgmtv1alpha1.JobMapping) (string, error) {
ih := col.Transformer.Config.GetUuidConfig().IncludeHyphen
return fmt.Sprintf("uuidtransformer(%t)", ih), nil
case "null":
return "transformernull()", nil
return "null", nil
case "random_bool":
return "randombooltransformer()", nil
case "random_string":
Expand Down
10 changes: 10 additions & 0 deletions worker/pkg/workflows/datasync/activities/activities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,3 +296,13 @@ func strPtr(val string) *string {
func boolPtr(val bool) *bool {
return &val
}

func TestNullTransformer(t *testing.T) {

val, err := computeMutationFunction(&mgmtv1alpha1.JobMapping{Transformer: &mgmtv1alpha1.Transformer{
Value: "null"}})

assert.NoError(t, err)

assert.Equal(t, val, "null")
}

0 comments on commit 6a63186

Please sign in to comment.