johannaojeling commented on code in PR #25437:
URL: https://github.com/apache/beam/pull/25437#discussion_r1108977986


##########
sdks/go/pkg/beam/core/runtime/exec/sdf_invokers.go:
##########
@@ -39,61 +43,45 @@ import (
 
 // cirInvoker is an invoker for CreateInitialRestriction.
 type cirInvoker struct {
-       fn   *funcx.Fn
-       args []any // Cache to avoid allocating new slices per-element.
-       call func(elms *FullValue) (rest any)
+       fn     *funcx.Fn
+       args   []any // Cache to avoid allocating new slices per-element.
+       ctxIdx int
+       call   func() (rest any, err error)
 }
 
 func newCreateInitialRestrictionInvoker(fn *funcx.Fn) (*cirInvoker, error) {
        n := &cirInvoker{
                fn:   fn,
                args: make([]any, len(fn.Param)),
        }
+
+       var ok bool
+       if n.ctxIdx, ok = fn.Context(); !ok {
+               n.ctxIdx = -1
+       }
+
        if err := n.initCallFn(); err != nil {
                return nil, errors.WithContext(err, "sdf 
CreateInitialRestriction invoker")
        }
        return n, nil
 }
 
-func (n *cirInvoker) initCallFn() error {
-       // Expects a signature of the form:
-       // (key?, value) restriction
-       // TODO(BEAM-9643): Link to full documentation.
-       switch fnT := n.fn.Fn.(type) {
-       case reflectx.Func1x1:

Review Comment:
   Ok I see. Thanks for the explanation and review!



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