Skip to content

Commit

Permalink
sdks/go: go doc utf-8 check comment on encode DoFn
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedawnallah committed Feb 11, 2025
1 parent 771d22f commit ec29bda
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sdks/go/pkg/beam/core/runtime/graphx/serialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ec29bda

Please sign in to comment.