{"record":{"id":"ad6b01e996461ffd","repo":"apache/beam","slug":"unsupported-type-primitive-type","errorCode":null,"errorMessage":"Unsupported type: {primitive_type}","messagePattern":"Unsupported type: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/gen_managed_doc.py","lineNumber":318,"sourceCode":"  if documented:\n    return field_name in documented\n  else:  # ignored\n    return field_name not in ignored\n\n\ndef spaces(n: int):\n  return \" \" * n\n\n\ndef get_type_color(primitive_type: str):\n  if primitive_type == \"str\":\n    return \"green\"\n  elif primitive_type.startswith(\"int\"):\n    return \"#f54251\"\n  elif primitive_type == \"boolean\":\n    return \"orange\"\n\n  raise ValueError(\"Unsupported type: \" + primitive_type)\n\n\ndef get_type_format_html(type: str, with_paranthesis: bool):\n  if type.startswith(\"map\"):\n    regex = r\"map\\[(.*?),\\s*(.*?)\\]\"\n    match = re.search(regex, type)\n    key_type = match.group(1)\n    value_type = match.group(2)\n    key_color = get_type_color(key_type)\n    value_color = get_type_color(value_type)\n    html_type = (\n        '<code>map['\n        f'<span style=\"color: {key_color};\">{key_type}</span>, '\n        f'<span style=\"color: {value_color};\">{value_type}</span>]'\n        '</code>')\n  elif type.startswith(\"list\"):\n    regex = r\"list\\[(.*?)\\]\"\n    match = re.search(regex, type)","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/gen_managed_doc.py#L300-L336","documentation":"get_type_color maps schema primitive type strings to HTML colors for the generated managed-transform documentation. Types outside the known set (string, int*, boolean, etc.) fall through and raise ValueError('Unsupported type: ...').","triggerScenarios":"A config field in the documented manifest declares a primitive type string not handled by get_type_color's if/elif chain (e.g. a new or misspelled type) while rendering type-format HTML.","commonSituations":"Adding a new Beam managed config with a novel field type without updating the doc generator; a typo like 'strings' instead of 'string'.","solutions":["Check the type string in the config for typos and correct it.","Add an elif branch to get_type_color in gen_managed_doc.py returning a color for the new primitive type.","Re-run the doc generator."],"exampleFix":"// before (gen_managed_doc.py)\n  elif primitive_type == \"boolean\":\n    return \"orange\"\n// after\n  elif primitive_type == \"boolean\":\n    return \"orange\"\n  elif primitive_type.startswith(\"bytes\"):\n    return \"purple\"","handlingStrategy":"try-catch","validationCode":"SUPPORTED = {'string', 'boolean', 'integer', 'int64', 'int32', 'double', 'float', 'bytes'}\nfor f in config_fields:\n    assert f['type'] in SUPPORTED or f['type'].startswith(('int', 'map')), f['type']","typeGuard":"def is_supported_primitive(t):\n    return isinstance(t, str) and (t in SUPPORTED or t.startswith(('int', 'map')))","tryCatchPattern":"try:\n    html = get_type_format_html(field_type)\nexcept ValueError as e:\n    print(f'Add a color mapping for this type: {e}')","preventionTips":["Use only types already handled by get_type_color when adding configs.","Add tests covering every primitive type in the manifest.","Update get_type_color together with any new schema type."],"tags":["code-generation","docs","schema-types","apache-beam"],"backgroundTag":"unsupported-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"}