{"record":{"id":"d65589f5e63238f5","repo":"apache/beam","slug":"f-unknown-window-type-window-type","errorCode":null,"errorMessage":"f'Unknown window type {window_type}'","messagePattern":"f'Unknown window type (.+?)'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_provider.py","lineNumber":1166,"sourceCode":"      if window_type == 'global':\n        window_fn = window.GlobalWindows()\n      elif window_type == 'fixed':\n        window_fn = window.FixedWindows(\n            YamlProviders.WindowInto._parse_duration(spec.pop('size'), 'size'),\n            YamlProviders.WindowInto._parse_duration(\n                spec.pop('offset', 0), 'offset'))\n      elif window_type == 'sliding':\n        window_fn = window.SlidingWindows(\n            YamlProviders.WindowInto._parse_duration(spec.pop('size'), 'size'),\n            YamlProviders.WindowInto._parse_duration(\n                spec.pop('period'), 'period'),\n            YamlProviders.WindowInto._parse_duration(\n                spec.pop('offset', 0), 'offset'))\n      elif window_type == 'sessions':\n        window_fn = window.Sessions(\n            YamlProviders.WindowInto._parse_duration(spec.pop('gap'), 'gap'))\n      else:\n        raise ValueError(f'Unknown window type {window_type}')\n      if spec:\n        raise ValueError(f'Unknown parameters {spec.keys()}')\n      # TODO: Triggering, etc.\n      return beam.WindowInto(window_fn)\n\n  @staticmethod\n  @beam.ptransform_fn\n  @maybe_with_exception_handling_transform_fn\n  def log_for_testing(\n      pcoll, *, level: Optional[str] = 'INFO', prefix: Optional[str] = ''):\n    \"\"\"Logs each element of its input PCollection.\n\n    The output of this transform is a copy of its input for ease of use in\n    chain-style pipelines.\n\n    Args:\n      level: one of ERROR, INFO, or DEBUG, mapped to a corresponding\n        language-specific logging level","sourceCodeStart":1148,"sourceCodeEnd":1184,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_provider.py#L1148-L1184","documentation":"Raised by YamlProviders.WindowInto when the window 'type' parameter is not one of the supported window types (fixed, sliding, sessions). The YAML WindowInto transform dispatches on window_type and throws for anything else.","triggerScenarios":"Specifying type: global, type: interval, or any misspelled type (e.g. 'session' singular, 'Fixed') in the YAML WindowInto transform config.","commonSituations":"YAML pipeline authors copy window types from other frameworks, misspell 'sessions', or assume unsupported types like calendar or global windows are available (triggering/advanced windows are TODO in this provider).","solutions":["Use one of the supported types: 'fixed', 'sliding', or 'sessions'.","Fix casing/typos, e.g. 'session' -> 'sessions'.","If you need another window type, use the Python WindowInto transform directly instead of the YAML transform."],"exampleFix":"# before\n- type: AssignWindows\n  config:\n    type: session\n    gap: 30s\n# after\n- type: AssignWindows\n  config:\n    type: sessions\n    gap: 30s","handlingStrategy":"validation","validationCode":"SUPPORTED = {'fixed', 'sliding', 'sessions'}\ndef validate_window_type(t):\n    if t not in SUPPORTED:\n        raise ValueError(f'window type {t!r} not in {sorted(SUPPORTED)}')","typeGuard":"def is_supported_window_type(t):\n    return isinstance(t, str) and t in {'fixed', 'sliding', 'sessions'}","tryCatchPattern":"try:\n    transform = YamlProviders.WindowInto(spec)\nexcept ValueError as e:\n    if str(e).startswith('Unknown window type'):\n        logging.error('Unsupported window type; use fixed/sliding/sessions')\n        raise\n    raise","preventionTips":["Use a JSON-schema/enum dropdown when generating window configs.","Copy types only from this provider's docs, not other frameworks.","Add CI validation of window 'type' against the allowed set."],"tags":["python","apache-beam","yaml","windowing"],"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"}