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


##########
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:
   That makes sense. If additonal optional sdf methods are added in the future 
then it will make the existing switch much larger. So I guess, I'll have a 
separate switch for optional SDFs.



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