{"record":{"id":"324a06df089e9bfe","repo":"apache/beam","slug":"unknown-windowinto-option-type-t-v","errorCode":null,"errorMessage":"Unknown WindowInto option type: %T: %v","messagePattern":"Unknown WindowInto option type: %T: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/windowing.go","lineNumber":100,"sourceCode":"\t\treturn PCollection{}, errors.New(\"invalid scope\")\n\t}\n\tif !col.IsValid() {\n\t\treturn PCollection{}, errors.New(\"invalid input pcollection\")\n\t}\n\tws := window.WindowingStrategy{Fn: wfn, Trigger: trigger.DefaultTrigger{}}\n\tfor _, opt := range opts {\n\t\tswitch opt := opt.(type) {\n\t\tcase windowTrigger:\n\t\t\t// TODO(BEAM-3304): call validation on trigger construction here\n\t\t\t// so local errors can be returned to the user in their pipeline\n\t\t\t// context instead of at pipeline translation time.\n\t\t\tws.Trigger = opt.trigger\n\t\tcase accumulationMode:\n\t\t\tws.AccumulationMode = opt.mode\n\t\tcase allowedLateness:\n\t\t\tws.AllowedLateness = int(opt.delay / time.Millisecond)\n\t\tdefault:\n\t\t\tpanic(fmt.Sprintf(\"Unknown WindowInto option type: %T: %v\", opt, opt))\n\t\t}\n\t}\n\n\tedge := graph.NewWindowInto(s.real, s.scope, &ws, col.n)\n\tret := PCollection{edge.Output[0].To}\n\treturn ret, nil\n}\n","sourceCodeStart":82,"sourceCodeEnd":108,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/windowing.go#L82-L108","documentation":"beam.TryWindowInto accepts windowing options (trigger, accumulation mode, allowed lateness, etc.) and panics when it encounters an option value of a type it does not recognize. This indicates a bad or unsupported value was passed as a WindowInto option, or a new option type exists that this code path doesn't handle.","triggerScenarios":"Passing an unexpected value as a WindowIntoOption to beam.WindowInto / TryWindowInto — e.g. a raw duration, nil option, or a custom struct instead of the provided trigger/accumulationMode/allowedLateness option constructors.","commonSituations":"Hand-rolling option values instead of using the exported option helpers; copying option code from an older Beam version where option types changed; typos creating plain values where option wrappers are expected.","solutions":["Use the exported option constructors (windowing.Trigger, accumulation mode, allowed lateness helpers) instead of raw values.","Check the %T in the message to see which wrong type was passed.","Update to a Beam version where the option type you need is supported.","Wrap the WindowInto call in a recover in library code and report the unsupported option."],"exampleFix":"// before\nbeam.WindowInto(s, window.WhenDuration(30*time.Second), col) // not a supported option type\n// after\nbeam.WindowInto(s, window.FixedWindows(30*time.Second), col)","handlingStrategy":"validation","validationCode":"// Only pass option values produced by the windowing package's constructors,\n// never raw durations or custom structs:\nopt := window.Trigger.Default() // use exported constructors only","typeGuard":"// No reliable runtime type guard outside beam; restrict option construction to\n// the package's exported option types (trigger, accumulationMode, allowedLateness).","tryCatchPattern":"defer func() {\n    if r := recover(); r != nil {\n        if s, ok := r.(string); ok && strings.Contains(s, \"Unknown WindowInto option type\") {\n            log.Fatalf(\"bad windowing option: %s\", s)\n        }\n        panic(r)\n    }\n}()","preventionTips":["Use only exported windowing option constructors","Don't copy option patterns from outdated Beam versions","Check the %T printed in the panic to identify the bad type","Keep the Beam SDK upgraded so all option types are recognized"],"tags":["go","panic","windowing","invalid-option"],"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"}