{"record":{"id":"f366a7260c6ec402","repo":"apache/beam","slug":"message-specifies-a-destination-for-an-invalid-sdk-sdk-the","errorCode":null,"errorMessage":"{message} specifies a destination for an invalid SDK: '{sdk}'. The supported SDKs are {SUPPORTED_SDK_DESTINATIONS}","messagePattern":"(.+?) specifies a destination for an invalid SDK: '(.+?)'\\. The supported SDKs are (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/gen_xlang_wrappers.py","lineNumber":197,"sourceCode":"        \"# NOTE: This file is autogenerated and should \"\n        \"not be edited by hand.\\n\")\n    f.write(\n        \"# Configs are generated based on the expansion service\\n\"\n        f\"# configuration in {input_services.replace(PROJECT_ROOT, '')}.\\n\")\n    f.write(\"# Refer to gen_xlang_wrappers.py for more info.\\n\")\n    dt = datetime.datetime.now().date()\n    f.write(f\"#\\n# Last updated on: {dt}\\n\\n\")\n    yaml.dump(transform_list, f)\n  logging.info(\"Successfully wrote transform configs to file: %s\", output_file)\n\n\ndef validate_sdks_destinations(sdk, dest, service, identifier=None):\n  if identifier:\n    message = f\"Identifier '{identifier}'\"\n  else:\n    message = f\"Service '{service}'\"\n  if sdk not in SUPPORTED_SDK_DESTINATIONS:\n    raise ValueError(\n        message + \" specifies a destination for an invalid SDK:\"\n        f\" '{sdk}'. The supported SDKs are {SUPPORTED_SDK_DESTINATIONS}\")\n  if not os.path.isdir(os.path.join(PYTHON_SDK_ROOT, *dest.split('/'))):\n    raise ValueError(\n        message + f\" specifies an invalid destination '{dest}'.\"\n        \" Please make sure the destination is an existing directory.\")\n\n\ndef pretty_type(tp):\n  \"\"\"\n  Takes a type and returns a tuple containing a pretty string representing it\n  and a bool signifying if it is nullable or not.\n\n  For optional types, the contained type is unwrapped and returned. This does\n  not recurse however, so inner Optional types are not affected.\n  E.g. the input typing.Optional[typing.Dict[int, typing.Optional[str]]] will\n  return (Dict[int, Union[str, NoneType]], True)\n  \"\"\"","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/gen_xlang_wrappers.py#L179-L215","documentation":"validate_sdks_destinations checks that each SDK key in an expansion service's destinations mapping is one of SUPPORTED_SDK_DESTINATIONS. An unknown SDK key (e.g. a typo or a newly added SDK not yet supported by the generator) raises ValueError listing the supported SDKs.","triggerScenarios":"A destinations entry in the expansion services YAML (or an identifier-annotated per-transform override) uses an SDK name not present in SUPPORTED_SDK_DESTINATIONS during generate_transforms_config.","commonSituations":"Typo like 'py' or 'Python' instead of 'python'; adding a new SDK destination before updating SUPPORTED_SDK_DESTINATIONS.","solutions":["Correct the SDK key in the YAML to one of the supported names listed in the error message.","If a new SDK must be supported, add it to SUPPORTED_SDK_DESTINATIONS in gen_xlang_wrappers.py along with generation logic.","Re-run the wrapper generation."],"exampleFix":"// before\n  destinations:\n    py: sdks/python/apache_beam/transforms\n// after\n  destinations:\n    python: sdks/python/apache_beam/transforms","handlingStrategy":"validation","validationCode":"from gen_xlang_wrappers import SUPPORTED_SDK_DESTINATIONS\nfor svc in services:\n    for sdk in svc['destinations']:\n        assert sdk in SUPPORTED_SDK_DESTINATIONS, f\"bad sdk key: {sdk}\"","typeGuard":"def has_valid_sdks(svc):\n    from gen_xlang_wrappers import SUPPORTED_SDK_DESTINATIONS\n    return all(s in SUPPORTED_SDK_DESTINATIONS for s in svc.get('destinations', {}))","tryCatchPattern":"try:\n    generate_transforms_config(services_yaml, ...)\nexcept ValueError as e:\n    if 'invalid SDK' in str(e):\n        print('Use one of the supported SDK keys listed in the error')","preventionTips":["Reuse the exact SDK keys from existing YAML entries.","Add SUPPORTED_SDK_DESTINATIONS membership checks to config linting.","Update SUPPORTED_SDK_DESTINATIONS before adding a new SDK destination."],"tags":["yaml","validation","code-generation","invalid-key"],"backgroundTag":"invalid-enum-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"}