{"record":{"id":"48a7e74ba6239ec5","repo":"apache/beam","slug":"unexpected-edge-v","errorCode":null,"errorMessage":"unexpected edge: %v","messagePattern":"unexpected edge: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/direct/direct.go","lineNumber":343,"sourceCode":"\t\t// on a single worker. Hoist the next node up in the cache.\n\t\tb.links[id] = out[0]\n\t\treturn b.links[id], nil\n\n\tcase graph.Flatten:\n\t\tu = &exec.Flatten{UID: b.idgen.New(), N: len(edge.Input), Out: out[0]}\n\n\t\tfor i := 0; i < len(edge.Input); i++ {\n\t\t\tb.links[linkID{edge.ID(), i}] = u\n\t\t}\n\n\tcase graph.WindowInto:\n\t\tu = &exec.WindowInto{UID: b.idgen.New(), Fn: edge.WindowFn, Out: out[0]}\n\n\tcase graph.External:\n\t\treturn nil, errors.Errorf(\"external transforms like %v are not supported in the Go direct runner, please execute your pipeline on a different runner\", edge)\n\n\tdefault:\n\t\treturn nil, errors.Errorf(\"unexpected edge: %v\", edge)\n\t}\n\n\tb.links[id] = u\n\tb.units = append(b.units, u)\n\treturn u, nil\n}\n","sourceCodeStart":325,"sourceCodeEnd":350,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/direct/direct.go#L325-L350","documentation":"makeLink's switch falls through to a default branch when the edge's Op is one the translator does not recognize. This means the graph contains an operation type the direct runner's translation table does not handle — either a very new edge kind from a newer SDK or an internal inconsistency. It is wrapped as 'unexpected edge: %v'.","triggerScenarios":"Compile/makeLinks walks an edge whose graph.Op is not one of the handled cases (CoGBK, ParDo, WindowInto, External, etc.) — typically after custom graph construction or an SDK version mismatch.","commonSituations":"Mixing Beam Go SDK module versions (go.mod misalignment) where the graph package emits ops the direct runner doesn't know; experimental/custom edges introduced by internal tooling; hand-built graphs in tests.","solutions":["Check go.mod for mixed versions of github.com/apache/beam/sdks/v2 submodules and align them (go get -u ./... && go mod tidy).","Upgrade the Beam Go SDK to the latest patch release — a newer op may simply be unhandled in your version.","Identify the edge printed in the message; if it comes from custom graph code, ensure you only create edges with supported Ops.","Report upstream if a stock SDK pipeline reproduces it (likely an SDK bug)."],"exampleFix":"// before\nrequire github.com/apache/beam/sdks/v2 v2.45.0\nrequire github.com/apache/beam/sdks/v2/go/pkg/beam v2.52.0 // mismatched\n// after\nrequire github.com/apache/beam/sdks/v2 v2.52.0\n// then: go mod tidy && go build ./...","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if _, err := beam.Run(ctx, runner, p); err != nil && strings.Contains(err.Error(), \"unexpected edge\") {\n    log.Printf(\"check Beam SDK version alignment: %v\", err)\n}","preventionTips":["Keep all beam module requires at the same version; run go mod tidy.","Avoid hand-manipulating the pipeline graph.","Upgrade SDK before adding new transform kinds."],"tags":["go","beam","direct-runner","version-mismatch","pipeline"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}