{"record":{"id":"9146a7d8146e3343","repo":"apache/beam","slug":"value-is-not-a-valid-windowing-parameter-must-be-one-of-list","errorCode":null,"errorMessage":"{value} is not a valid windowing parameter; must be one of {list(_WINDOWING_INFO_TYPES.keys())}","messagePattern":"(.+?) is not a valid windowing parameter; must be one of (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_mapping.py","lineNumber":956,"sourceCode":"  Args:\n    fields: A mapping of new field names to various windowing parameters,\n      as documented above.  If omitted, defaults to\n      `[timestamp, window_start, window_end]`.\n  \"\"\"\n  if fields is None:\n    fields = ['timestamp', 'window_start', 'window_end']\n  if not isinstance(fields, Mapping):\n    if isinstance(fields, Iterable) and not isinstance(fields, str):\n      fields = {fld: fld for fld in fields}\n    else:\n      raise TypeError(\n          'Fields must be a mapping or iterable of strings, got {fields}')\n\n  existing_fields = named_fields_from_element_type(pcoll.element_type)\n  new_fields = []\n  for field, value in fields.items():\n    if value not in _WINDOWING_INFO_TYPES:\n      raise ValueError(\n          f'{value} is not a valid windowing parameter; '\n          f'must be one of {list(_WINDOWING_INFO_TYPES.keys())}')\n    elif field in existing_fields:\n      raise ValueError(f'Input schema already has a field named {field}.')\n    else:\n      new_fields.append((field, _WINDOWING_INFO_TYPES[value]))\n\n  def augment_row(\n      row,\n      timestamp=beam.DoFn.TimestampParam,\n      window=beam.DoFn.WindowParam,\n      pane_info=beam.DoFn.PaneInfoParam):\n    as_dict = row._asdict()\n    for field, value in fields.items():\n      as_dict[field] = _WINDOWING_INFO_EXTRACTORS[value](locals())\n    return beam.Row(**as_dict)\n\n  return pcoll | beam.Map(augment_row).with_output_types(","sourceCodeStart":938,"sourceCodeEnd":974,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_mapping.py#L938-L974","documentation":"`_ExtractWindowingInfo` only allows a fixed set of windowing parameters (keys of `_WINDOWING_INFO_TYPES`, e.g. timestamp, window_start, window_end). yaml_mapping.py:956 raises ValueError when a requested value is not one of these valid parameters.","triggerScenarios":"A `fields` mapping/entry references a value like 'window' or 'end' that is not a key in _WINDOWING_INFO_TYPES.","commonSituations":"Guessing parameter names ('window_end' vs 'end'); copying field names from other frameworks; misspelling a valid parameter.","solutions":["Use only the supported values: timestamp, window_start, window_end (per _WINDOWING_INFO_TYPES).","Check the error message's 'must be one of' list and correct the spelling/casing.","Map a custom output field name to a valid parameter, e.g. {my_ts: timestamp}."],"exampleFix":"# before\nfields: {ts: time, ws: window_start}\n# after\nfields: {ts: timestamp, ws: window_start}","handlingStrategy":"validation","validationCode":"VALID = {'timestamp', 'window_start', 'window_end'}\nbad = [v for v in fields.values()] if isinstance(fields, Mapping) else fields\ninvalid = [v for v in (bad or []) if v not in VALID]\nassert not invalid, f'invalid windowing params: {invalid}'","typeGuard":"def is_windowing_param(v):\n    return v in ('timestamp', 'window_start', 'window_end')","tryCatchPattern":"try:\n    pc = extract_windowing_info(pc, fields=fields)\nexcept ValueError as e:\n    raise YamlConfigError(str(e)) from e","preventionTips":["Only use the exact parameter names listed in the error message.","Use mapping form {new_name: parameter} to pick valid values with custom names.","Check Beam YAML docs for the current _WINDOWING_INFO_TYPES set."],"tags":["python","apache-beam","yaml","invalid-value"],"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"}