{"record":{"id":"ba1ccfbdcc00b1f4","repo":"apache/beam","slug":"f-missing-transform-transform-in-mappings","errorCode":null,"errorMessage":"f'Missing transform {transform} in mappings.'","messagePattern":"f'Missing transform (.+?) in mappings\\.'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_provider.py","lineNumber":1500,"sourceCode":"\n\n@ExternalProvider.register_provider_type('renaming')\nclass RenamingProvider(Provider):\n  def __init__(\n      self,\n      transforms,\n      provider_base_path,\n      mappings,\n      underlying_provider,\n      defaults=None):\n    if isinstance(underlying_provider, dict):\n      underlying_provider = ExternalProvider.provider_from_spec(\n          provider_base_path, underlying_provider)\n    self._transforms = transforms\n    self._underlying_provider = underlying_provider\n    for transform in transforms.keys():\n      if transform not in mappings:\n        raise ValueError(f'Missing transform {transform} in mappings.')\n    self._mappings = self.expand_mappings(mappings)\n    self._defaults = defaults or {}\n\n  @staticmethod\n  def expand_mappings(mappings):\n    if not isinstance(mappings, dict):\n      raise ValueError(\n          \"RenamingProvider mappings must be dict of transform \"\n          \"mappings.\")\n    for key, value in mappings.items():\n      if isinstance(value, str):\n        if value not in mappings.keys():\n          raise ValueError(\n              \"RenamingProvider transform mappings must be dict or \"\n              \"specify transform that has mappings within same \"\n              \"provider.\")\n        mappings[key] = mappings[value]\n    return mappings","sourceCodeStart":1482,"sourceCodeEnd":1518,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_provider.py#L1482-L1518","documentation":"Raised by RenamingProvider's constructor when a transform it is supposed to expose (a key of 'transforms') has no corresponding entry in the provided mappings. Every exposed transform must have a rename/alias mapping to an underlying transform.","triggerScenarios":"Creating a RenamingProvider where transforms lists a transform name (e.g. 'MyRead') that is absent from the mappings dict, typically after adding a new transform to the underlying provider without updating mappings.","commonSituations":"Version drift: the underlying provider gained a transform, or a typo in the mappings key means the transform name doesn't match exactly.","solutions":["Add a mapping entry for the missing transform, e.g. mappings: {'MyRead': 'ActualRead'}.","Fix typos so the transform key matches a key in mappings exactly.","Remove the transform from the transforms list if it should not be exposed."],"exampleFix":"# before\nRenamingProvider(provider, transforms=['MyRead'], mappings={})\n# after\nRenamingProvider(provider, transforms=['MyRead'], mappings={'MyRead': 'Read'})","handlingStrategy":"validation","validationCode":"def validate_renaming_provider(transforms, mappings):\n    missing = [t for t in transforms if t not in mappings]\n    if missing:\n        raise ValueError(f'Transforms missing from mappings: {missing}')","typeGuard":null,"tryCatchPattern":"try:\n    provider = RenamingProvider(base, transforms, mappings)\nexcept ValueError as e:\n    if 'Missing transform' in str(e):\n        logging.error('Add mappings for all exposed transforms: %s', e)\n        raise\n    raise","preventionTips":["Keep the transforms and mappings lists in lockstep; derive mappings keys from transforms at build time.","Regenerate mappings when the underlying provider's transform set changes (e.g. Beam upgrades).","Add a unit test that constructs the provider to catch drift early."],"tags":["python","apache-beam","yaml","provider"],"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"}