{"record":{"id":"ba81857bfed7bb0f","repo":"apache/beam","slug":"unknown-time-domain-s","errorCode":null,"errorMessage":"Unknown time domain: %s","messagePattern":"Unknown time domain: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/transforms/timeutil.py","lineNumber":50,"sourceCode":"class TimeDomain(object):\n  \"\"\"Time domain for streaming timers.\"\"\"\n\n  WATERMARK = 'WATERMARK'\n  REAL_TIME = 'REAL_TIME'\n  DEPENDENT_REAL_TIME = 'DEPENDENT_REAL_TIME'\n\n  _RUNNER_API_MAPPING = {\n      WATERMARK: beam_runner_api_pb2.TimeDomain.EVENT_TIME,\n      REAL_TIME: beam_runner_api_pb2.TimeDomain.PROCESSING_TIME,\n  }\n\n  @staticmethod\n  def from_string(domain):\n    if domain in (TimeDomain.WATERMARK,\n                  TimeDomain.REAL_TIME,\n                  TimeDomain.DEPENDENT_REAL_TIME):\n      return domain\n    raise ValueError('Unknown time domain: %s' % domain)\n\n  @staticmethod\n  def to_runner_api(domain):\n    return TimeDomain._RUNNER_API_MAPPING[domain]\n\n  @staticmethod\n  def is_event_time(domain):\n    return TimeDomain.from_string(domain) == TimeDomain.WATERMARK\n\n\nclass TimestampCombinerImpl(metaclass=ABCMeta):\n  \"\"\"Implementation of TimestampCombiner.\"\"\"\n  @abstractmethod\n  def assign_output_time(self, window, input_timestamp):\n    raise NotImplementedError\n\n  @abstractmethod\n  def combine(self, output_timestamp, other_output_timestamp):","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/transforms/timeutil.py#L32-L68","documentation":"TimeDomain.from_string converts a string/enum value into a TimeDomain enum and raises ValueError when the value is not one of WATERMARK, REAL_TIME, or DEPENDENT_REAL_TIME. The library throws it to fail fast on unrecognized time-domain names in windowing/trigger timer configuration.","triggerScenarios":"Calling TimeDomain.from_string with any string other than the exact enum names, e.g. from_string('processing_time') or from_string('event_time'), instead of the TimeDomain enum members.","commonSituations":"Hand-written pipeline descriptions or runner-internal configs that store time domains as free-form strings; typos in config files; code written against a Beam version whose enum had different member names.","solutions":["Use the TimeDomain enum members (TimeDomain.WATERMARK, TimeDomain.REAL_TIME, TimeDomain.DEPENDENT_REAL_TIME) instead of raw strings.","If given a string, map/normalize it to the enum before calling from_string.","Check spelling and case of the domain string against the enum member names."],"exampleFix":"// before\ndomain = TimeDomain.from_string('processing_time')\n// after\ndomain = TimeDomain.from_string(TimeDomain.REAL_TIME)","handlingStrategy":"validation","validationCode":"VALID = {TimeDomain.WATERMARK, TimeDomain.REAL_TIME, TimeDomain.DEPENDENT_REAL_TIME}\nassert domain in VALID, f'Unsupported time domain: {domain}'","typeGuard":"def is_valid_time_domain(d):\n    return d in (TimeDomain.WATERMARK, TimeDomain.REAL_TIME, TimeDomain.DEPENDENT_REAL_TIME)","tryCatchPattern":"try:\n    td = TimeDomain.from_string(domain_str)\nexcept ValueError:\n    td = TimeDomain.WATERMARK  # documented default","preventionTips":["Always use TimeDomain enum members, never raw strings.","Normalize config strings through an explicit mapping dict.","Keep domain values in configs consistent with the enum names of your Beam version."],"tags":["python","apache-beam","time-domain","enum","valueerror"],"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"}