lostluck commented on a change in pull request #11144: [BEAM-3301] Perform SDF 
validation (missing RestrictionTrackers).
URL: https://github.com/apache/beam/pull/11144#discussion_r394722487
 
 

 ##########
 File path: sdks/go/pkg/beam/core/graph/fn.go
 ##########
 @@ -569,6 +622,188 @@ func validateSideInputsNumUnknown(processFnInputs 
[]funcx.FnParam, method *funcx
        return nil
 }
 
+// validateSdfMethods validates that all SDF methods are either present or
+// missing in a Fn, and then returns true if they're present and false
+// otherwise. If some are present and some are missing, it returns an error.
+func validateSdfMethodsPresent(fn *Fn) (bool, error) {
+       // Check if first sdf method is present or not, and compare all 
subsequent
+       // methods to that result. If there's a mismatch, then we only fail 
after
+       // finishing the loop so we can output all the missing methods.
+       missing := make([]string, 0)
 
 Review comment:
   Prefer declaring empty slices using the var syntax.
   
   var missing []string

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to