{"record":{"id":"4869f65e86aed35a","repo":"apache/beam","slug":"missing-combine-parameter-in-combine-config","errorCode":null,"errorMessage":"Missing combine parameter in Combine config.","messagePattern":"Missing combine parameter in Combine config\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_combine.py","lineNumber":80,"sourceCode":"          type: fn_type\n  \"\"\"\n  from apache_beam.yaml.yaml_transform import SafeLineLoader\n  if spec['type'] == 'Combine':\n    config = spec.get('config')\n    if isinstance(config.get('group_by'), str):\n      config['group_by'] = [config['group_by']]\n\n    def normalize_agg(dest, agg):\n      if isinstance(agg, str):\n        agg = {'fn': agg}\n      if 'value' not in agg and config.get('language') != 'sql':\n        agg['value'] = dest\n      if isinstance(agg['fn'], str):\n        agg['fn'] = {'type': agg['fn']}\n      return agg\n\n    if 'combine' not in config:\n      raise ValueError('Missing combine parameter in Combine config.')\n    config['combine'] = {\n        dest: normalize_agg(dest, agg)\n        for (dest,\n             agg) in SafeLineLoader.strip_metadata(config['combine']).items()\n    }\n  return spec\n\n\nclass PyJsYamlCombine(beam.PTransform):\n  \"\"\"Groups and combines records sharing common fields.\n\n  Built-in combine functions are BUILTIN_COMBINE_FNS\n  but custom aggregation functions can be used as well.\n\n  See also the documentation on\n  [YAML Aggregation](https://beam.apache.org/documentation/sdks/yaml-combine/).\n\n  Args:","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_combine.py#L62-L98","documentation":"normalize_combine in apache_beam.yaml.yaml_combine requires the Combine transform's config to contain a 'combine' parameter mapping output fields to aggregation specs. Missing it means the transform has nothing to aggregate.","triggerScenarios":"Specifying a Combine transform in YAML whose config lacks the 'combine' key, e.g. config: {group_by: [...]} only.","commonSituations":"Hand-written YAML pipelines omitting the combine section; refactors that move aggregations out but leave an empty Combine; copy-paste from GroupBy examples.","solutions":["Add a 'combine' mapping in the transform config, e.g. combine: {total: {fn: sum, value: price}}.","If you only need grouping without aggregation, use the GroupBy transform instead of Combine.","Validate the YAML against Beam's Combine schema docs before running."],"exampleFix":"// before\n- type: Combine\n  input: my_input\n  config:\n    group_by: [user]\n// after\n- type: Combine\n  input: my_input\n  config:\n    group_by: [user]\n    combine:\n      total: {fn: sum, value: amount}","handlingStrategy":"validation","validationCode":"def validate_combine_config(config: dict):\n    if not isinstance(config, dict) or 'combine' not in config:\n        raise SystemExit('Combine transform requires config.combine, e.g. combine: {total: {fn: sum, value: price}}')","typeGuard":"def is_valid_combine_spec(config) -> bool:\n    return isinstance(config, dict) and isinstance(config.get('combine'), dict) and len(config['combine']) > 0","tryCatchPattern":"try:\n    normalize_combine(spec)\nexcept ValueError as e:\n    if 'Missing combine parameter' in str(e):\n        raise SystemExit('Fix YAML: add a combine: mapping to the Combine transform config') from e\n    raise","preventionTips":["Template Combine transforms with both group_by and combine sections","Lint YAML pipelines against the Beam transform schema in CI","Copy from official Beam YAML examples rather than hand-writing configs"],"tags":["yaml","config","beam-yaml"],"backgroundTag":"missing-required-config-field","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"}