You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/10/11 18:53:44 UTC

[GitHub] [beam] lostluck commented on a change in pull request #15703: [BEAM-12960] Add extra context for structural DoFn ProcessElement error

lostluck commented on a change in pull request #15703:
URL: https://github.com/apache/beam/pull/15703#discussion_r726503099



##########
File path: sdks/go/pkg/beam/core/graph/fn.go
##########
@@ -385,6 +385,12 @@ func AsDoFn(fn *Fn, numMainIn mainInputs) (*DoFn, error) {
 
 	if _, ok := fn.methods[processElementName]; !ok {
 		err := errors.Errorf("failed to find %v method", processElementName)
+		if fn.Recv != nil {
+			v := reflect.ValueOf(fn.Recv)
+			if v.Kind() != reflect.Ptr {
+				err = errors.Wrap(err, "structural DoFn passed by value, ensure that ProcessElement method is value receiving or have DoFn passed by pointer")

Review comment:
       ```suggestion
   				err = errors.Wrap(err, "structural DoFn passed by value, ensure that the ProcessElement method has a value receiver or pass the DoFn by pointer")
   ```




-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org