{"record":{"id":"36bebf0c7c5e00af","repo":"apache/beam","slug":"encountered-option-with-unsupported-type-only-atomic-type","errorCode":null,"errorMessage":"Encountered option with unsupported type. Only atomic_type and array_type options are supported: {type_proto}","messagePattern":"Encountered option with unsupported type\\. Only atomic_type and array_type options are supported: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/typehints/schemas.py","lineNumber":500,"sourceCode":"\n    return atomic_value\n\n  def value_from_runner_api(\n      self,\n      type_proto: schema_pb2.FieldType,\n      value_proto: schema_pb2.FieldValue):\n    type_info = type_proto.WhichOneof(\"type_info\")\n    if type_info == \"atomic_type\":\n      return self.atomic_value_from_runner_api(\n          type_proto.atomic_type, value_proto.atomic_value)\n    elif type_info == \"array_type\":\n      element_type = type_proto.array_type.element_type\n      return [\n          self.value_from_runner_api(element_type, element)\n          for element in value_proto.array_value.element\n      ]\n    else:\n      raise ValueError(\n          \"Encountered option with unsupported type. Only atomic_type and \"\n          f\"array_type options are supported: {type_proto}\")\n\n  def value_to_runner_api(self, typing_proto: schema_pb2.FieldType, value):\n    type_info = typing_proto.WhichOneof(\"type_info\")\n    if type_info == \"atomic_type\":\n      return schema_pb2.FieldValue(\n          atomic_value=self.atomic_value_to_runner_api(\n              typing_proto.atomic_type, value))\n    elif type_info == \"array_type\":\n      element_type = typing_proto.array_type.element_type\n      return schema_pb2.FieldValue(\n          array_value=schema_pb2.ArrayTypeValue(\n              element=[\n                  self.value_to_runner_api(element_type, element)\n                  for element in value\n              ]))\n    else:","sourceCodeStart":482,"sourceCodeEnd":518,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/typehints/schemas.py#L482-L518","documentation":"`value_from_runner_api` decodes option values from proto and only supports atomic_type and array_type FieldTypes. If the proto says the option's type is something else (e.g. map_type, row_type, logical_type), it raises this ValueError because there is no Python value representation implemented for it.","triggerScenarios":"Receiving/decoding an Option proto whose type_info is map_type, row_type, iterable_type, etc. — typically an option set by a Java/Go pipeline or newer SDK with a non-atomic, non-array option value.","commonSituations":"Cross-language transforms that attach structured options; pipelines built in another SDK decoded by Python.","solutions":["Restructure the option to be a plain atomic or array value (flatten maps/rows into primitives)","Handle the option in the producing SDK differently or drop it before crossing into Python","Upgrade apache-beam in case support was added later"],"exampleFix":"// before\nOption('params', value={'a': 1})  # map_type not supported when decoded\n// after\nOption('params', value=['a=1'])  # array of strings","handlingStrategy":"validation","validationCode":"info = type_proto.WhichOneof('type_info')\nif info not in ('atomic_type', 'array_type'):\n  raise ValueError(f'option type {info} not supported in Python')","typeGuard":null,"tryCatchPattern":"try:\n  name, val = converter.option_from_runner_api(opt)\nexcept ValueError:\n  name, val = opt.name, None  # fallback: skip structured options","preventionTips":["Keep option values flat: scalars or arrays only","Avoid structured options in cross-language pipelines consumed by Python"],"tags":["python","schema","options","protobuf"],"backgroundTag":"unsupported-operation","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"}