{"record":{"id":"13b7f7e4d2e79c60","repo":"apache/beam","slug":"unable-to-translate-self-full-label","errorCode":null,"errorMessage":"Unable to translate {self.full_label}","messagePattern":"Unable to translate (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/pipeline.py","lineNumber":1509,"sourceCode":"        return None\n      else:\n        # We only populate inputs information to ParDo in order to expose\n        # key_coder and window_coder to stateful DoFn.\n        if isinstance(transform, ParDo):\n          return transform.to_runner_api(\n              context,\n              has_parts=bool(self.parts),\n              named_inputs=self.named_inputs())\n        elif hasattr(transform, 'to_runner_api'):\n          return transform.to_runner_api(context, has_parts=bool(self.parts))\n        return None\n\n    # Iterate over inputs and outputs by sorted key order, so that ids are\n    # consistently generated for multiple runs of the same pipeline.\n    try:\n      transform_spec = transform_to_runner_api(self.transform, context)\n    except Exception as exn:\n      raise RuntimeError(f'Unable to translate {self.full_label}') from exn\n    environment_id = self.environment_id\n    transform_urn = transform_spec.urn if transform_spec else None\n    if (not environment_id and\n        (transform_urn not in Pipeline.runner_implemented_transforms())):\n      environment_id = context.get_environment_id_for_resource_hints(\n          self.resource_hints)\n    if self.transform is not None:\n      display_data = DisplayData.create_from(\n          self.transform, extra_items=self.display_data)\n    else:\n      display_data = None\n\n    return beam_runner_api_pb2.PTransform(\n        unique_name=self.full_label,\n        spec=transform_spec,\n        subtransforms=[\n            context.transforms.get_id(part, label=part.full_label)\n            for part in self.parts","sourceCodeStart":1491,"sourceCodeEnd":1527,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/pipeline.py#L1491-L1527","documentation":"RuntimeError (wrapping the original exception) raised when AppliedPTransform.to_runner_api cannot convert the transform to its runner-api representation via transform_to_runner_api. It indicates the transform could not be serialized — usually because its URN/type is unregistered or its payload construction failed.","triggerScenarios":"Applying a custom PTransform subclass without a registered URN in a cross-language or FnAPI context; transform.expand payload serialization failing; pickling failures for lambdas in transform specs.","commonSituations":"Portable/Flink/Spark runners requiring registered transforms; external transform misconfiguration; custom transforms using unpicklable closures.","solutions":["Read the chained 'from exn' cause for the real root error and fix that (e.g. unpicklable lambda, missing URN registration)","Register the custom transform's URN via the transforms registry or use standard Beam transforms","If running with a portable runner, replace lambda-based DoFns with top-level functions/classes"],"exampleFix":"// before\nresult = pcoll | beam.Map(lambda x: (x, x * 2))\n// after\ndef multiply(x):\n    return (x, x * 2)\nresult = pcoll | beam.Map(multiply)","handlingStrategy":"try-catch","validationCode":"import pickle\ntry:\n    pickle.dumps(my_transform)\nexcept Exception as e:\n    print('Transform not serializable:', e)","typeGuard":null,"tryCatchPattern":"try:\n    proto = p.to_runner_api(context=ctx)\nexcept RuntimeError as e:\n    logging.error('Translation failed: %s; root cause: %s', e, e.__cause__)","preventionTips":["Always inspect e.__cause__ for the underlying serialization error","Avoid lambdas and module-level mutable state inside DoFns for portable runners","Register custom transform URNs when required by the runner"],"tags":["python","apache-beam","runner-api","serialization"],"backgroundTag":"serialization-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}