{"record":{"id":"38fd8554e2afc093","repo":"apache/beam","slug":"unrecognized-atomic-type-atomic-type-when-decoding-value","errorCode":null,"errorMessage":"Unrecognized atomic_type ({atomic_type}) when decoding value {atomic_value!r}","messagePattern":"Unrecognized atomic_type \\((.+?)\\) when decoding value (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/typehints/schemas.py","lineNumber":452,"sourceCode":"      value = np.int8(atomic_value.byte)\n    elif atomic_type == schema_pb2.INT16:\n      value = np.int16(atomic_value.int16)\n    elif atomic_type == schema_pb2.INT32:\n      value = np.int32(atomic_value.int32)\n    elif atomic_type == schema_pb2.INT64:\n      value = np.int64(atomic_value.int64)\n    elif atomic_type == schema_pb2.FLOAT:\n      value = np.float32(atomic_value.float)\n    elif atomic_type == schema_pb2.DOUBLE:\n      value = np.float64(atomic_value.double)\n    elif atomic_type == schema_pb2.STRING:\n      value = atomic_value.string\n    elif atomic_type == schema_pb2.BOOLEAN:\n      value = atomic_value.boolean\n    elif atomic_type == schema_pb2.BYTES:\n      value = atomic_value.bytes\n    else:\n      raise ValueError(\n          f\"Unrecognized atomic_type ({atomic_type}) \"\n          f\"when decoding value {atomic_value!r}\")\n\n    return value\n\n  def atomic_value_to_runner_api(\n      self, atomic_type: schema_pb2.AtomicType,\n      value) -> schema_pb2.AtomicTypeValue:\n    if atomic_type == schema_pb2.BYTE:\n      atomic_value = schema_pb2.AtomicTypeValue(byte=value)\n    elif atomic_type == schema_pb2.INT16:\n      atomic_value = schema_pb2.AtomicTypeValue(int16=value)\n    elif atomic_type == schema_pb2.INT32:\n      atomic_value = schema_pb2.AtomicTypeValue(int32=value)\n    elif atomic_type == schema_pb2.INT64:\n      atomic_value = schema_pb2.AtomicTypeValue(int64=value)\n    elif atomic_type == schema_pb2.FLOAT:\n      atomic_value = schema_pb2.AtomicTypeValue(float=value)","sourceCodeStart":434,"sourceCodeEnd":470,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/typehints/schemas.py#L434-L470","documentation":"When decoding a schema FieldValue from the runner's proto form, `atomic_value_from_runner_api` only handles STRING, INT, DOUBLE, BOOLEAN, BYTES atomic types. Any other atomic_type in the proto (e.g. new enum values added in a newer Beam protocol version) has no Python mapping and triggers this ValueError.","triggerScenarios":"Calling `value_from_runner_api` (or materializing a typed schema) with an AtomicTypeValue proto whose atomic_type enum is not one of the recognized values — commonly protos produced by a newer runner/SDK than the local one.","commonSituations":"Cross-language pipelines where another SDK writes a schema with an atomic type the Python SDK version doesn't know; Beam version mismatch between runner and SDK.","solutions":["Upgrade apache-beam to a version whose schema_pb2 knows the atomic type","Inspect the failing proto's atomic_type value and confirm it's a supported one (STRING/INT/DOUBLE/BOOLEAN/BYTES)","Align runner and SDK versions so the schema protos match"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"supported = {schema_pb2.STRING, schema_pb2.INT, schema_pb2.DOUBLE, schema_pb2.BOOLEAN, schema_pb2.BYTES}\nassert atomic_type in supported, f'unsupported atomic_type {atomic_type}'","typeGuard":null,"tryCatchPattern":"try:\n  value = converter.value_from_runner_api(tp, proto)\nexcept ValueError as e:\n  log.error('runner proto uses unsupported atomic type; upgrade SDK'); raise","preventionTips":["Keep apache-beam version aligned with your runner","Avoid cross-language schemas with exotic atomic types"],"tags":["python","schema","protobuf","decoding"],"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"}