From ec29bda87be8e1b7a36ad4076d59e7904e63040f Mon Sep 17 00:00:00 2001 From: Mohamed Awnallah Date: Tue, 11 Feb 2025 17:07:54 +0000 Subject: [PATCH] sdks/go: go doc utf-8 check comment on encode DoFn --- sdks/go/pkg/beam/core/runtime/graphx/serialize.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdks/go/pkg/beam/core/runtime/graphx/serialize.go b/sdks/go/pkg/beam/core/runtime/graphx/serialize.go index fb62e18e1306..ec1532c901da 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/serialize.go +++ b/sdks/go/pkg/beam/core/runtime/graphx/serialize.go @@ -208,6 +208,11 @@ func ms2duration(d int64) time.Duration { return time.Duration(d) * time.Millisecond } +// encodeFn encodes a graph.Fn into a v1pb.Fn proto message. +// All string fields in the DoFn struct must be UTF-8 compliant. The vet runner +// (--beam_strict) will detect any non-UTF8 strings that would fail during JSON serialization. +// The check will be skipped for subtypes that implement the MarshalJSON and +// UnmarshalJSON interface methods. func encodeFn(u *graph.Fn) (*v1pb.Fn, error) { switch { case u.DynFn != nil: