riteshghorse commented on code in PR #17770:
URL: https://github.com/apache/beam/pull/17770#discussion_r883030058
##########
sdks/go/pkg/beam/core/graph/fn.go:
##########
@@ -1003,6 +1003,14 @@ func validateSdfSigTypes(fn *Fn, num int) error {
"Ensure that all restrictions in an SDF
are the same type.",
truncateRestrictionName, 0,
method.Ret[0].T, restrictionT, createInitialRestrictionName)
}
+ processFn := fn.methods[processElementName]
+ if len(processFn.Ret) > 0 &&
processFn.Ret[len(processFn.Ret)-1].T !=
reflect.TypeOf((*sdf.ProcessContinuation)(nil)).Elem() {
+ err := errors.Errorf("mismatched output type in
method %v, return %v: got: %v, want: %v",
+ processElementName,
len(processFn.Ret)-1, method.Ret[len(processFn.Ret)-1].T,
reflect.TypeOf((*sdf.ProcessContinuation)(nil)).Elem())
+ return errors.SetTopLevelMsgf(err, "Mismatched
output type in method %v, "+
+ "return value at index %v. Got: %v,
Want: %v (from method %v).",
+ processElementName,
len(processFn.Ret)-1, method.Ret[len(processFn.Ret)-1].T,
reflect.TypeOf((*sdf.ProcessContinuation)(nil)).Elem(), truncateRestrictionName)
+ }
Review Comment:
oh, got it. Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]