{"record":{"id":"e6593a7d1edf2859","repo":"apache/beam","slug":"invalid-timestampcombiner-s","errorCode":null,"errorMessage":"Invalid TimestampCombiner: %s.","messagePattern":"Invalid TimestampCombiner: (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/transforms/window.py","lineNumber":118,"sourceCode":"  OUTPUT_AT_EARLIEST = beam_runner_api_pb2.OutputTime.EARLIEST_IN_PANE\n  OUTPUT_AT_LATEST = beam_runner_api_pb2.OutputTime.LATEST_IN_PANE\n  # TODO(robertwb): Add this to the runner API or remove it.\n  OUTPUT_AT_EARLIEST_TRANSFORMED = 'OUTPUT_AT_EARLIEST_TRANSFORMED'\n\n  @staticmethod\n  def get_impl(\n      timestamp_combiner: beam_runner_api_pb2.OutputTime.Enum,\n      window_fn: 'WindowFn') -> timeutil.TimestampCombinerImpl:\n    if timestamp_combiner == TimestampCombiner.OUTPUT_AT_EOW:\n      return timeutil.OutputAtEndOfWindowImpl()\n    elif timestamp_combiner == TimestampCombiner.OUTPUT_AT_EARLIEST:\n      return timeutil.OutputAtEarliestInputTimestampImpl()\n    elif timestamp_combiner == TimestampCombiner.OUTPUT_AT_LATEST:\n      return timeutil.OutputAtLatestInputTimestampImpl()\n    elif timestamp_combiner == TimestampCombiner.OUTPUT_AT_EARLIEST_TRANSFORMED:\n      return timeutil.OutputAtEarliestTransformedInputTimestampImpl(window_fn)\n    else:\n      raise ValueError('Invalid TimestampCombiner: %s.' % timestamp_combiner)\n\n\nclass WindowFn(urns.RunnerApiFn, metaclass=abc.ABCMeta):\n  \"\"\"An abstract windowing function defining a basic assign and merge.\"\"\"\n  class AssignContext(object):\n    \"\"\"Context passed to WindowFn.assign().\"\"\"\n    def __init__(\n        self,\n        timestamp: TimestampTypes,\n        element: Optional[Any] = None,\n        window: Optional['BoundedWindow'] = None) -> None:\n      self.timestamp = Timestamp.of(timestamp)\n      self.element = element\n      self.window = window\n\n  @abc.abstractmethod\n  def assign(self,\n             assign_context: 'AssignContext') -> Iterable['BoundedWindow']:","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/transforms/window.py#L100-L136","documentation":"TimestampCombiner.get_impl() maps each supported TimestampCombiner enum value to a timeutil implementation; an unrecognized value falls through the elif chain and raises ValueError. This means an invalid or foreign TimestampCombiner instance reached the windowing strategy.","triggerScenarios":"Passing a non-TimestampCombiner object (string like 'earliest', an int, or None) as the timestamp_combiner in WindowInto's Windowing; or a stale/custom enum member from a different Beam version.","commonSituations":"Config-driven windowing where the combiner comes from YAML/CLI as a string and is never converted to TimestampCombiner.X; version mismatch where a combiner existed in one Beam release but not another.","solutions":["Use an enum member: TimestampCombiner.OUTPUT_AT_EARLIEST / _LATEST / _EARLIEST_TRANSFORMED","Convert strings explicitly: TimestampCombiner[config_value] or a mapping dict","Check the Beam version supports the chosen combiner (OUTPUT_AT_EARLIEST_TRANSFORMED requires newer releases)"],"exampleFix":"// before\nbeam.WindowInto(FixedWindows(60), timestamp_combiner='earliest')\n// after\nbeam.WindowInto(FixedWindows(60), timestamp_combiner=TimestampCombiner.OUTPUT_AT_EARLIEST)","handlingStrategy":"validation","validationCode":"VALID = {TimestampCombiner.OUTPUT_AT_EARLIEST, TimestampCombiner.OUTPUT_AT_LATEST, TimestampCombiner.OUTPUT_AT_EARLIEST_TRANSFORMED}\nif timestamp_combiner not in VALID:\n    raise ValueError('invalid timestamp_combiner')","typeGuard":"def is_combiner(v): return isinstance(v, TimestampCombiner)","tryCatchPattern":null,"preventionTips":["Always use TimestampCombiner enum members, never strings","Map external config names through a lookup dict","Pin Beam versions and check enum availability on upgrades"],"tags":["python","apache-beam","windowing","enum","timestamp"],"backgroundTag":"invalid-enum-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"}