{"record":{"id":"b0b77ea6bce24210","repo":"apache/beam","slug":"missing-inputs-for-transform-at-identify-object-spec","errorCode":null,"errorMessage":"Missing inputs for transform at {identify_object(spec)}","messagePattern":"Missing inputs for transform at (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_transform.py","lineNumber":396,"sourceCode":"    providers_by_input = {k: v for k, v in self.input_providers.items()}\n    input_providers = [\n        providers_by_input[pcoll] for pcoll in input_pcolls\n        if pcoll in providers_by_input\n    ]\n    provider = self.best_provider(spec, input_providers)\n    extra_dependencies, spec = extract_extra_dependencies(spec)\n    if extra_dependencies:\n      provider = provider.with_extra_dependencies(frozenset(extra_dependencies))\n\n    config = SafeLineLoader.strip_metadata(spec.get('config', {}))\n    if not isinstance(config, dict):\n      raise ValueError(\n          'Config for transform at %s must be a mapping.' %\n          identify_object(spec))\n\n    if (not input_pcolls and not is_explicitly_empty(spec.get('input', {})) and\n        provider.requires_inputs(spec['type'], config)):\n      raise ValueError(\n          f'Missing inputs for transform at {identify_object(spec)}')\n\n    try:\n      if spec['type'].endswith('-generic'):\n        # Centralize the validation rather than require every implementation\n        # to do it.\n        validate_generic_expressions(\n            spec['type'].rsplit('-', 1)[0], config, input_pcolls)\n\n      # pylint: disable=undefined-loop-variable\n      ptransform = maybe_with_resource_hints(\n          provider.create_transform(\n              spec['type'],\n              config,\n              lambda config, input_pcolls=input_pcolls: self.create_ptransform(\n                  config, input_pcolls)))\n      # TODO(robertwb): Should we have a better API for adding annotations\n      # than this?","sourceCodeStart":378,"sourceCodeEnd":414,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_transform.py#L378-L414","documentation":"Most transforms require input PCollections. If a transform receives no inputs (`input_pcolls` empty), the `input` field is not explicitly empty, and its provider declares `requires_inputs(type, config)` true, create_ptransform raises this ValueError at the spec's location.","triggerScenarios":"Declaring a consumer transform (e.g. MapToFields, Filter, Write) without an `input:` field, or with an input that resolves to nothing; source-type transforms misconfigured so they are treated as consumers.","commonSituations":"Forgetting the `input:` key on non-source transforms; indentation placing `input` inside `config`; deleting an upstream transform while leaving its consumer; broken input references.","solutions":["Add an `input:` field referencing an existing source transform or pipeline input.","Fix indentation so `input:` is a top-level key of the transform spec.","If the transform is intentionally a root, use a source type (e.g. ReadFromBigQuery) that does not require inputs.","Trace the chain to ensure the referenced upstream transform still exists."],"exampleFix":"# before\n- name: filter_rows\n  type: Filter\n  config:\n    keep: 'x > 0'\n# after\n- name: filter_rows\n  type: Filter\n  input: read_rows\n  config:\n    keep: 'x > 0'","handlingStrategy":"validation","validationCode":"SOURCES = {'ReadFromBigQuery', 'ReadFromKafka', 'ReadFromPubSub'}\nfor t in pipeline['transforms']:\n    if t['type'] not in SOURCES and 'input' not in t:\n        raise ValueError(f'{t.get(\"name\")}: non-source transform needs input:')","typeGuard":"def has_input(spec):\n    return 'input' in spec and spec['input'] is not None","tryCatchPattern":"try:\n    run_pipeline(spec)\nexcept ValueError as e:\n    if 'Missing inputs' in str(e):\n        raise UserPipelineError(f'{spec.get(\"name\")}: add an input: reference') from e","preventionTips":["Add input: to every consumer transform","Keep input: at spec top level, not inside config","Verify upstream transforms still exist after edits"],"tags":["yaml","beam-yaml","pipeline-definition","missing-field"],"backgroundTag":"missing-required-argument","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"}