{"record":{"id":"cc589049dc06a179","repo":"apache/beam","slug":"s-iscompatible-should-never-be-called-it-is-a-private","errorCode":null,"errorMessage":"%s.isCompatible() should never be called. It is a private implementation detail of sdk utilities. This message indicates a bug in the Beam SDK.","messagePattern":"(.+?)\\.isCompatible\\(\\) should never be called\\. It is a private implementation detail of sdk utilities\\. This message indicates a bug in the Beam SDK\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/util/IdentityWindowFn.java","lineNumber":73,"sourceCode":"  public IdentityWindowFn(Coder<? extends BoundedWindow> coder) {\n    // Safe because it is only used privately here.\n    // At every point where a window is returned or accepted, it has been provided\n    // by the prior WindowFn, so it is of the expected type.\n    @SuppressWarnings(\"unchecked\")\n    Coder<BoundedWindow> windowCoder = (Coder<BoundedWindow>) coder;\n    this.coder = windowCoder;\n  }\n\n  @Override\n  public Collection<BoundedWindow> assignWindows(WindowFn<T, BoundedWindow>.AssignContext c)\n      throws Exception {\n    // The window is provided by the prior WindowFn, which also provides the coder for them\n    return Collections.singleton(c.window());\n  }\n\n  @Override\n  public boolean isCompatible(WindowFn<?, ?> other) {\n    throw new UnsupportedOperationException(\n        String.format(\n            \"%s.isCompatible() should never be called.\"\n                + \" It is a private implementation detail of sdk utilities.\"\n                + \" This message indicates a bug in the Beam SDK.\",\n            getClass().getCanonicalName()));\n  }\n\n  @Override\n  public void verifyCompatibility(WindowFn<?, ?> other) throws IncompatibleWindowException {\n    throw new UnsupportedOperationException(\n        String.format(\n            \"%s.verifyCompatibility() should never be called.\"\n                + \" It is a private implementation detail of sdk utilities.\"\n                + \" This message indicates a bug in the Beam SDK.\",\n            getClass().getCanonicalName()));\n  }\n\n  @Override","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IdentityWindowFn.java#L55-L91","documentation":"IdentityWindowFn is a private implementation detail used internally by SDK utilities (e.g. to pass windows through unchanged). Its isCompatible() is deliberately unimplemented: calling it means Beam's internal plumbing invoked a WindowFn that was never meant to participate in window-merging compatibility checks — a genuine SDK bug.","triggerScenarios":"Calling isCompatible() directly on IdentityWindowFn, or pipeline code that requires window-fn compatibility checking across an IdentityWindowFn boundary (e.g. applying it in a user pipeline or combining it with windowing operations the SDK doesn't expect).","commonSituations":"Users manually constructing IdentityWindowFn in custom transforms; Beam version mismatches where internal utilities changed; custom runners calling isCompatible during stage planning on windows propagated via IdentityWindowFn.","solutions":["Remove user-level use of IdentityWindowFn; it is not a public API — use Window.into()/reassign semantics instead","Report the stack trace to the Beam project (JIRA/GitHub) — the message itself says this indicates a Beam SDK bug","Check for mismatched Beam SDK versions on the classpath (e.g. runner vs SDK) and align them"],"exampleFix":"// before\nPCollection<T> out = c.apply(new IdentityWindowFn<>(originalWindowFn.windowCoder()));\n// after\nPCollection<T> out = c.apply(Window.<T>into(originalWindowFn)); // public API, or don't reassign windows at all","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  windowFn.isCompatible(other);\n} catch (UnsupportedOperationException e) {\n  LOG.error(\"IdentityWindowFn.isCompatible invoked — likely a Beam SDK bug; report stack trace\", e);\n  throw e;\n}","preventionTips":["Do not use IdentityWindowFn in user pipelines; it is an internal utility","Keep runner and SDK Beam versions aligned","Report occurrences with full stack traces to the Beam project"],"tags":["java","windows","unsupported-operation","sdk-bug"],"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"}