riteshghorse commented on code in PR #17432:
URL: https://github.com/apache/beam/pull/17432#discussion_r859911593


##########
sdks/go/pkg/beam/core/graph/fn.go:
##########
@@ -847,9 +886,15 @@ func validateSdfSigNumbers(fn *Fn, num int) error {
 func validateSdfSigTypes(fn *Fn, num int) error {
        restrictionT := fn.methods[createInitialRestrictionName].Ret[0].T
        rTrackerT := reflect.TypeOf((*sdf.RTracker)(nil)).Elem()
-
-       for _, name := range requiredSdfNames {
-               method := fn.methods[name]
+       bRTrackerT := fn.methods[createTrackerName].Ret[0].T
+       optionalSdfs := optionalSdfNameMap()
+
+       for _, name := range sdfNames {
+               method, ok := fn.methods[name]
+               if !ok && optionalSdfs[name] {
+                       // skip validating unimplemented optional sdf methodsß
+                       continue
+               }

Review Comment:
   Yeah, optional sdf functions should be validated but only when they are 
implemented by users. Otherwise, we should skip its validation. 



-- 
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]

Reply via email to