diff --git a/sdks/go/pkg/beam/core/runtime/graphx/translate.go b/sdks/go/pkg/beam/core/runtime/graphx/translate.go index db21e0fd5f75..b28820966a8a 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/translate.go +++ b/sdks/go/pkg/beam/core/runtime/graphx/translate.go @@ -30,7 +30,7 @@ import ( "github.com/apache/beam/sdks/v2/go/pkg/beam/internal/errors" pipepb "github.com/apache/beam/sdks/v2/go/pkg/beam/model/pipeline_v1" "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes" + "google.golang.org/protobuf/types/known/durationpb" ) // Model constants for interfacing with a Beam runner. @@ -1198,7 +1198,7 @@ func makeWindowFn(w *window.Fn) (*pipepb.FunctionSpec, error) { Urn: URNFixedWindowsWindowFn, Payload: protox.MustEncode( &pipepb.FixedWindowsPayload{ - Size: ptypes.DurationProto(w.Size), + Size: durationpb.New(w.Size), }, ), }, nil @@ -1207,8 +1207,8 @@ func makeWindowFn(w *window.Fn) (*pipepb.FunctionSpec, error) { Urn: URNSlidingWindowsWindowFn, Payload: protox.MustEncode( &pipepb.SlidingWindowsPayload{ - Size: ptypes.DurationProto(w.Size), - Period: ptypes.DurationProto(w.Period), + Size: durationpb.New(w.Size), + Period: durationpb.New(w.Period), }, ), }, nil @@ -1217,7 +1217,7 @@ func makeWindowFn(w *window.Fn) (*pipepb.FunctionSpec, error) { Urn: URNSessionsWindowFn, Payload: protox.MustEncode( &pipepb.SessionWindowsPayload{ - GapSize: ptypes.DurationProto(w.Gap), + GapSize: durationpb.New(w.Gap), }, ), }, nil diff --git a/sdks/go/pkg/beam/core/runtime/harness/logging.go b/sdks/go/pkg/beam/core/runtime/harness/logging.go index a798f4ec3567..3835bf7ef56f 100644 --- a/sdks/go/pkg/beam/core/runtime/harness/logging.go +++ b/sdks/go/pkg/beam/core/runtime/harness/logging.go @@ -27,7 +27,7 @@ import ( "github.com/apache/beam/sdks/v2/go/pkg/beam/internal/errors" "github.com/apache/beam/sdks/v2/go/pkg/beam/log" fnpb "github.com/apache/beam/sdks/v2/go/pkg/beam/model/fnexecution_v1" - "github.com/golang/protobuf/ptypes" + "google.golang.org/protobuf/types/known/timestamppb" ) // TODO(herohde) 10/12/2017: make this file a separate package. Then @@ -56,7 +56,7 @@ type logger struct { } func (l *logger) Log(ctx context.Context, sev log.Severity, calldepth int, msg string) { - now, _ := ptypes.TimestampProto(time.Now()) + now := timestamppb.New(time.Now()) entry := &fnpb.LogEntry{ Timestamp: now,