{"record":{"id":"0cfc2d055015b79e","repo":"apache/beam","slug":"invalid-transform-specification-at-identify-object-spec-msg","errorCode":null,"errorMessage":"Invalid transform specification at {identify_object(spec)}: {msg}","messagePattern":"Invalid transform specification at (.+?): (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_transform.py","lineNumber":453,"sourceCode":"              record_providers(p)\n          elif isinstance(pvalueish, beam.PCollection):\n            if pvalueish not in self.input_providers:\n              self.input_providers[pvalueish] = provider\n\n        record_providers(result)\n        return result\n\n      ptransform.expand = recording_expand\n      return ptransform\n    except Exception as exn:\n      if isinstance(exn, TypeError):\n        # Create a slightly more generic error message for argument errors.\n        msg = str(exn).replace('positional', '').replace('keyword', '')\n        msg = re.sub(r'\\S+lambda\\S+', '', msg)\n        msg = re.sub('  +', ' ', msg).strip()\n      else:\n        msg = str(exn)\n      raise ValueError(\n          f'Invalid transform specification at {identify_object(spec)}: {msg}'\n      ) from exn\n\n  def unique_name(self, spec, ptransform, strictness=0):\n    if 'name' in spec:\n      name = spec['name']\n      strictness += 1\n    elif ('ExternalTransform' not in ptransform.label and\n          not ptransform.label.startswith('_')):\n      # The label may have interesting information.\n      name = ptransform.label\n    else:\n      name = spec['type']\n    if name in self._seen_names:\n      if strictness >= 2:\n        raise ValueError(f'Duplicate name at {identify_object(spec)}: {name}')\n      else:\n        name = f'{name}@{SafeLineLoader.get_line(spec)}'","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_transform.py#L435-L471","documentation":"When the provider's transform expansion/validation raises an exception (e.g. an argument error from wrong config kwargs), create_ptransform wraps it in a cleaner ValueError: 'Invalid transform specification at {location}: {message}'. It is a normalized wrapper around any underlying config/argument error for the transform.","triggerScenarios":"Passing config options that do not match the transform's signature — unknown/misspelled option names, wrong value types, missing required options — so the underlying callable raises, or any exception raised during provider validation of the spec.","commonSituations":"Typos in config option names; string where a list/int is expected; missing required options; option names that changed between Beam versions; invalid expression syntax in field expressions.","solutions":["Read the wrapped message — it contains the original error text identifying the bad option or value.","Compare your config keys against the transform's documented schema.","Fix the option types/values (lists, ints, valid expressions) at the reported location.","Align apache-beam version with the pipeline spec if option names changed between releases."],"exampleFix":"# before\n- type: MapToFields\n  config:\n    language: sql\n    feilds:\n      upper: UPPER(name)\n# after\n- type: MapToFields\n  config:\n    language: sql\n    fields:\n      upper: UPPER(name)","handlingStrategy":"try-catch","validationCode":"KNOWN_OPTIONS = {'fields', 'language', 'append', 'error_handling'}  # per-transform schema\nbad = set(spec.get('config', {})) - KNOWN_OPTIONS\nif bad:\n    raise ValueError(f'Unknown options {bad} for {spec[\"type\"]}')","typeGuard":"def config_matches_schema(spec, schema):\n    return all(k in schema for k in spec.get('config', {}))","tryCatchPattern":"try:\n    run_pipeline(spec)\nexcept ValueError as e:\n    if 'Invalid transform specification' in str(e):\n        raise UserPipelineError(str(e)) from e  # inner message names the bad option/value","preventionTips":["Validate config against the transform's documented schema before submit","Match option names and types to your installed Beam version","Read the wrapped inner message — it pinpoints the offending argument"],"tags":["yaml","beam-yaml","pipeline-definition","config-validation"],"backgroundTag":"invalid-config-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"}