{"record":{"id":"e3ec0c816733017f","repo":"apache/beam","slug":"unrecognized-type-info-type-info-r-arrow-compatibility","errorCode":null,"errorMessage":"Unrecognized type_info: {type_info!r}","messagePattern":"Unrecognized type_info: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/typehints/arrow_type_compatibility.py","lineNumber":293,"sourceCode":"    output_arrow_type = pa.list_(\n        _arrow_field_from_beam_fieldtype(\n            beam_fieldtype.array_type.element_type))\n  elif type_info == \"map_type\":\n    output_arrow_type = _make_arrow_map(beam_fieldtype.map_type)\n  elif type_info == \"row_type\":\n    schema = beam_fieldtype.row_type.schema\n    # Note schema id and options are handled at the arrow field level, they are\n    # added at field-level metadata.\n    output_arrow_type = pa.struct(\n        [_arrow_field_from_beam_field(field) for field in schema.fields])\n  elif type_info == \"logical_type\":\n    # TODO(https://github.com/apache/beam/issues/23817): Add support for logical\n    # types.\n    raise NotImplementedError(\n        \"Beam logical types are not currently supported \"\n        \"in arrow_type_compatibility.\")\n  else:\n    raise ValueError(f\"Unrecognized type_info: {type_info!r}\")\n\n  return output_arrow_type\n\n\nclass PyarrowBatchConverter(BatchConverter):\n  def __init__(self, element_type: RowTypeConstraint):\n    super().__init__(pa.Table, element_type)\n    self._beam_schema = typing_to_runner_api(element_type).row_type.schema\n    arrow_schema = arrow_schema_from_beam_schema(self._beam_schema)\n\n    self._arrow_schema = arrow_schema\n\n  @staticmethod\n  def from_typehints(element_type,\n                     batch_type) -> Optional['PyarrowBatchConverter']:\n    assert batch_type == pa.Table\n\n    if not isinstance(element_type, RowTypeConstraint):","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/typehints/arrow_type_compatibility.py#L275-L311","documentation":"_arrow_type_from_beam_fieldtype switches on the FieldType's type_info oneof (atomic_type, array_type, map_type, row_type, logical_type). If type_info is anything else (or None for a malformed/empty FieldType), the code raises ValueError with the unrecognized value's repr.","triggerScenarios":"Passing a schema_pb2.FieldType with no type_info set (empty default FieldType) or a corrupted/forward-compat protobuf field from a newer Beam version through arrow conversion.","commonSituations":"Building FieldTypes manually and forgetting to set any type; deserializing schemas from a newer Beam/other SDK with a type_info this version doesn't know; protobuf default-constructed fields.","solutions":["Ensure every FieldType has exactly one type_info set (atomic_type, array_type, map_type, row_type)","Re-serialize/deserialize with matching Beam versions so unknown type_info variants aren't dropped","Validate the schema protobuf before conversion (check WhichOneof('type_info') is not None)"],"exampleFix":"// before\nft = schema_pb2.FieldType()  # no type_info set\n// after\nft = schema_pb2.FieldType(atomic_type=schema_pb2.STRING)","handlingStrategy":"validation","validationCode":"if ft.WhichOneof('type_info') is None:\n    raise TypeError('FieldType has no type_info set; must be one of atomic/array/map/row/logical')","typeGuard":"def has_type_info(ft) -> bool:\n    return ft.WhichOneof('type_info') is not None","tryCatchPattern":"try:\n    arrow_type = _arrow_type_from_beam_fieldtype(ft)\nexcept ValueError as e:\n    if str(e).startswith('Unrecognized type_info'):\n        raise SchemaError('malformed FieldType: no known type_info oneof set') from e\n    raise","preventionTips":["Never default-construct FieldTypes without setting a type variant","Use matching Beam versions when exchanging schema protobufs across services","Sanity-check WhichOneof('type_info') after deserialization"],"tags":["python","apache-beam","schema","protobuf"],"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"}