{"record":{"id":"827eb0a52c0c521e","repo":"apache/beam","slug":"missing-transform-type-identify-object-spec","errorCode":null,"errorMessage":"Missing transform type: {identify_object(spec)}","messagePattern":"Missing transform type: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_transform.py","lineNumber":341,"sourceCode":"        if len(possible_providers) == 1:\n          break\n        # Go downstream one more step.\n        adjacent_transforms = sum(\n            [list(self.followers(t)) for t in adjacent_transforms], [])\n\n    return possible_providers[0]\n\n  # A method on scope as providers may be scoped...\n  def create_ptransform(self, spec, input_pcolls):\n    def maybe_with_resource_hints(transform):\n      if 'resource_hints' in spec:\n        return transform.with_resource_hints(\n            **SafeLineLoader.strip_metadata(spec['resource_hints']))\n      else:\n        return transform\n\n    if 'type' not in spec:\n      raise ValueError(f'Missing transform type: {identify_object(spec)}')\n\n    if spec['type'] == 'composite':\n\n      class _CompositeTransformStub(beam.PTransform):\n        @staticmethod\n        def expand(pcolls):\n          if isinstance(pcolls, beam.PCollection):\n            pcolls = {'input': pcolls}\n          elif isinstance(pcolls, beam.pvalue.PBegin):\n            pcolls = {}\n\n          inner_scope = Scope(\n              self.root,\n              pcolls,\n              spec['transforms'],\n              self.providers,\n              self.input_providers)\n          inner_scope.compute_all()","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_transform.py#L323-L359","documentation":"Scope.create_ptransform builds a PTransform from a YAML spec. Every transform spec must carry a `type` field identifying which transform to instantiate; if `type` is absent, Beam raises this ValueError with the spec's location (identify_object).","triggerScenarios":"A transform entry in the pipeline YAML (or an inline dict passed to create_ptransform) lacking the `type` key — e.g. only `name` and `config` were given, or a malformed nested block.","commonSituations":"Hand-editing YAML and deleting the `type` line; indentation mistakes that swallow `type` into another mapping; programmatically constructed specs omitting `type`; config-only fragments left as list items.","solutions":["Add the required `type:` field to the transform spec at the reported location.","Fix YAML indentation so `type` is a sibling key of `name`/`config`, not nested.","If the entry was meant to reference another transform, use the input reference syntax instead of a transform block.","Run the pipeline through Beam's YAML validation/dry-run before submitting."],"exampleFix":"# before\n- name: read_rows\n  config:\n    table: my_table\n# after\n- name: read_rows\n  type: ReadFromBigQuery\n  config:\n    table: my_table","handlingStrategy":"validation","validationCode":"for t in pipeline.get('transforms', []):\n    if not isinstance(t, dict) or 'type' not in t:\n        raise ValueError(f'Transform missing type: {t.get(\"name\", t)}')","typeGuard":"def has_type(spec):\n    return isinstance(spec, dict) and isinstance(spec.get('type'), str) and bool(spec['type'])","tryCatchPattern":"try:\n    run_pipeline(spec)\nexcept ValueError as e:\n    if 'Missing transform type' in str(e):\n        raise UserPipelineError('Each transform entry needs a type: field') from e","preventionTips":["Enforce a JSON schema on pipeline YAML with required ['name','type','config']","Re-check indentation after hand edits so type stays a sibling key","Use templates/snippets with type pre-filled"],"tags":["yaml","beam-yaml","pipeline-definition","missing-field"],"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"}