Skip to content

Commit

Permalink
Register create functions to pass on prism. (#27713)
Browse files Browse the repository at this point in the history
Co-authored-by: lostluck <13907733+lostluck@users.noreply.github.com>
  • Loading branch information
lostluck and lostluck authored Jul 27, 2023
1 parent 5a54ee6 commit c3f1675
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sdks/go/pkg/beam/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ import (
"reflect"

"github.com/apache/beam/sdks/v2/go/pkg/beam/internal/errors"
"github.com/apache/beam/sdks/v2/go/pkg/beam/register"
)

func init() {
register.DoFn2x1[[]byte, func(T), error]((*createFn)(nil))
register.Emitter1[T]()
}

// Create inserts a fixed non-empty set of values into the pipeline. The values must
// be of the same type 'A' and the returned PCollection is of type A.
//
Expand Down
9 changes: 9 additions & 0 deletions sdks/go/pkg/beam/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ import (
"github.com/golang/protobuf/proto"
)

func TestMain(m *testing.M) {
ptest.Main(m)
}

func init() {
beam.RegisterType(reflect.TypeOf((*wc)(nil)).Elem())
beam.RegisterType(reflect.TypeOf((*testProto)(nil)).Elem())
}

type wc struct {
K string
V int
Expand Down

0 comments on commit c3f1675

Please sign in to comment.