{"record":{"id":"871bcf5d978cc0f0","repo":"apache/beam","slug":"unknown-timing-constant-timing","errorCode":null,"errorMessage":"Unknown timing constant: \" + timing","messagePattern":"Unknown timing constant: \" \\+ timing","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/typescript/src/apache_beam/coders/required_coders.ts","lineNumber":544,"sourceCode":"          \"Timing number 0b\" +\n            timingNumber.toString(2) +\n            \" has more than two bits of info\",\n        );\n    }\n  }\n\n  private static encodeTiming(timing: Timing): number {\n    switch (timing) {\n      case Timing.EARLY:\n        return 0b00;\n      case Timing.ON_TIME:\n        return 0b01;\n      case Timing.LATE:\n        return 0b10;\n      case Timing.UNKNOWN:\n        return 0b11;\n      default:\n        throw new Error(\"Unknown timing constant: \" + timing);\n    }\n  }\n\n  private static chooseEncoding(value: PaneInfo): number {\n    if (\n      (value.index === 0 && value.onTimeIndex === 0) ||\n      value.timing === Timing.UNKNOWN\n    ) {\n      return PaneInfoEncoding.NO_INDEX;\n    } else if (\n      value.index === value.onTimeIndex ||\n      value.timing === Timing.EARLY\n    ) {\n      return PaneInfoEncoding.ONE_INDEX;\n    } else {\n      return PaneInfoEncoding.TWO_INDICES;\n    }\n  }","sourceCodeStart":526,"sourceCodeEnd":562,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/typescript/src/apache_beam/coders/required_coders.ts#L526-L562","documentation":"ExternalTransform.to_runner_api_transform raises RuntimeError when translating an expanded external transform to its runner API form and more than one input tag was renamed (not present in the expanded transform's inputs). With non-preserved tags there is no way to map original tags to expanded tags unambiguously once two renames are seen, so the translation aborts. This is an internal consistency check during pipeline serialization.","triggerScenarios":"Applying an ExternalTransform whose expanded counterpart has a single input while the applied transform has multiple local input tags not matching the expanded tags, causing repeated single-input remapping; typically with multi-input external transforms whose tags were not preserved across expansion.","commonSituations":"Cross-language transforms where the Java expansion renamed/normalized input tags; manually constructed ExternalTransform objects with arbitrary tags; Beam version mismatch causing tag schema changes between SDK and expansion service.","solutions":["Ensure input tags match the expanded transform's tags; do not rename inputs of an external transform after expansion.","Upgrade/downgrade apache-beam so the Python SDK and the expansion service jar agree on tag naming.","Report/inspect the two key sets in the message to identify which transform's tags drifted."],"exampleFix":"// before\np | 'label' >> ExternalTransform(...).with_inputs({'wrong_tag': pcoll})\n// after\np | 'label' >> ExternalTransform(...).with_inputs({'expected_tag': pcoll})  # match expanded tags","handlingStrategy":"try-catch","validationCode":"assert set(t._inputs).issubset(set(t._expanded_transform.inputs)) or len(t._inputs) == 1","typeGuard":"def tags_preserved(local_inputs: dict, expanded_inputs: dict) -> bool:\n    return set(local_inputs) == set(expanded_inputs)","tryCatchPattern":"try:\n    run_pipeline(pipeline)\nexcept RuntimeError as e:\n    if 'non-preserved tags' in str(e):\n        logger.error('External transform input tags drifted; align SDK and jar versions: %s', e)\n    raise","preventionTips":["Keep apache-beam SDK and expansion service jar versions aligned","Do not rename input tags on external transforms after expansion","Use with_input/with_outputs with the tags the expansion service defines"],"tags":["python","apache-beam","runner-api","cross-language","internal"],"backgroundTag":"internal-invariant-violation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}