{"record":{"id":"c6d57affa50928d5","repo":"apache/beam","slug":"unexpected-inbound-class-v","errorCode":null,"errorMessage":"unexpected inbound class: %v","messagePattern":"unexpected inbound class: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/graph/bind.go","lineNumber":306,"sourceCode":"\t\t\t\tcase funcx.FnReIter:\n\t\t\t\t\tvalues, _ := funcx.UnfoldReIter(args[i].T)\n\t\t\t\t\ttrimmed := trimIllegal(values)\n\t\t\t\t\tif len(trimmed) != 1 {\n\t\t\t\t\t\treturn nil, kind, errors.Errorf(\"values of %v cannot bind to %v\", t, args[i])\n\t\t\t\t\t}\n\t\t\t\t\tcomponents = append(components, typex.New(trimmed[0]))\n\t\t\t\tdefault:\n\t\t\t\t\treturn nil, kind, errors.Errorf(\"values of %v cannot bind to %v\", t, args[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\tother = typex.NewCoGBK(components...)\n\n\t\tdefault:\n\t\t\treturn nil, kind, errors.Errorf(\"unexpected inbound type: %v\", t.Type())\n\t\t}\n\n\tdefault:\n\t\treturn nil, kind, errors.Errorf(\"unexpected inbound class: %v\", t.Class())\n\t}\n\n\tif !typex.IsStructurallyAssignable(t, other) {\n\t\treturn nil, kind, errors.Errorf(\"%v is not assignable to %v\", t, other)\n\t}\n\treturn other, kind, nil\n}\n\nfunc inboundArity(t typex.FullType, isMain bool) (int, error) {\n\tif t.Class() == typex.Composite {\n\t\tswitch t.Type() {\n\t\tcase typex.KVType:\n\t\t\tif isMain {\n\t\t\t\treturn 2, nil\n\t\t\t}\n\t\t\t// A KV side input must be a single iterator/map.\n\t\t\treturn 1, nil\n\t\tcase typex.CoGBKType:","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/graph/bind.go#L288-L324","documentation":"tryBindInbound validates the inbound FullType's class against a fixed switch; any class other than the supported ones (e.g. Single, Composite) falls to the default and throws. Beam's typex defines a closed set of FullType classes, and this binder only understands the subset valid for inputs. It fails fast at pipeline construction rather than at runtime.","triggerScenarios":"Calling ParDo/side-input binding with an inbound type whose t.Class() is outside the supported set — typically a malformed or intentionally invalid FullType passed to graph construction.","commonSituations":"Hand-constructing typex types for custom graph manipulation; using internal APIs directly instead of the beam package helpers; corrupted pipeline graph after custom transforms.","solutions":["Construct PCollections and inputs via the public beam package helpers instead of manual typex/graph types.","Check t.Class() from the error message and use a FullType whose class is Single or Composite.","Review custom graph-building code that creates typex.FullType values and fix the class used.","Pin/upgrade the SDK so the binder supports all typex classes present in your version."],"exampleFix":"// before: manual graph input with wrong typex class\nin := graph.NewInput(t /* invalid class */)\n// after: derive input from a PCollection\nin := beam.ParDo(s, myFn, pcoll)","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"// Go: only bind FullTypes of supported class\nfunc isBindableClass(t typex.FullType) bool {\n    c := t.Class()\n    return c == typex.Single || c == typex.Composite\n}","tryCatchPattern":null,"preventionTips":["Build pipeline graphs via the public beam package, not raw typex/graph internals.","Never fabricate FullType values by hand for inputs.","Review custom transform code that touches graph internals."],"tags":["go","type-binding","pipeline-construction"],"backgroundTag":"invalid-argument-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}