{"record":{"id":"b734477975d1a494","repo":"apache/beam","slug":"unknown-window-type-v","errorCode":null,"errorMessage":"unknown window type: %v","messagePattern":"unknown window type: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/graph/window/fn.go","lineNumber":109,"sourceCode":"// Built-in window types (such as global window) are only equal to the same\n// instances of the window. A user-defined window that happens to match a\n// built-in will not match on Equals().\nfunc (w *Fn) Equals(o *Fn) bool {\n\tif w.Kind != o.Kind {\n\t\treturn false\n\t}\n\n\tswitch w.Kind {\n\tcase GlobalWindows:\n\t\treturn true\n\tcase FixedWindows:\n\t\treturn w.Size == o.Size\n\tcase SlidingWindows:\n\t\treturn w.Period == o.Period && w.Size == o.Size\n\tcase Sessions:\n\t\treturn w.Gap == o.Gap\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"unknown window type: %v\", w))\n\t}\n}\n","sourceCodeStart":91,"sourceCodeEnd":112,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/graph/window/fn.go#L91-L112","documentation":"window (fn).Equals panics in its default case when a WindowFn's kind is not one of GlobalWindows, IntervalWindow, SlidingWindows, or Sessions. This indicates an unrecognized or unsupported window type is being compared, typically from a custom or unregistered WindowFn.","triggerScenarios":"Calling (w *WindowFn).Equals(o) on a WindowFn whose type is none of the four known kinds — e.g. a newly added or custom windowing strategy not handled by the switch — during pipeline translation where windowing strategies are compared.","commonSituations":"Using a custom WindowFn type added in a newer Beam version while running a translation code path that predates it; mixing Beam versions between libraries that both construct WindowFn values.","solutions":["Use a supported window type (GlobalWindows, IntervalWindow, SlidingWindows, Sessions)","If using a custom WindowFn, implement/extend Equals to handle it or upgrade Beam so the switch includes it","Check for version skew between the Beam SDK versions building and comparing the strategies"],"exampleFix":"// before\nfn := myCustomWindowFn{} // unknown to Equals\n// after\nfn := window.NewFixedWindows(60 * time.Second) // supported type","handlingStrategy":"type-guard","validationCode":"switch w.Kind {\ncase window.GlobalWindows, window.IntervalWindow, window.SlidingWindows, window.Sessions:\n\t// safe to compare\ndefault:\n\treturn fmt.Errorf(\"unsupported window type %T\", w)\n}","typeGuard":"func isKnownWindowType(w window.WindowFn) bool {\n\tswitch w.(type) {\n\tcase window.GlobalWindows, window.IntervalWindow, window.SlidingWindows, window.Sessions:\n\t\treturn true\n\t}\n\treturn false\n}","tryCatchPattern":"func safeEquals(w, o *window.WindowFn) (eq bool, err error) {\n\tdefer func() { if r := recover(); r != nil { err = fmt.Errorf(\"window equals: %v\", r) } }()\n\treturn w.Equals(o), nil\n}","preventionTips":["Stick to the four supported window kinds unless extending the SDK","Align Beam SDK versions across modules to avoid unrecognized WindowFn kinds","Handle custom WindowFns in your own comparison code"],"tags":["go","beam","windowing","unsupported"],"backgroundTag":"unsupported-operation","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"}