{"record":{"id":"389bb6ef2b65e059","repo":"apache/beam","slug":"unrecognized-type-info-type-info-r","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/io/avroio.py","lineNumber":683,"sourceCode":"    if beam_type.map_type.key_type.atomic_type != schema_pb2.STRING:\n      raise TypeError(\n          f'Only strings allowed as map keys when converting from AVRO, '\n          f'found {beam_type}')\n    value_converter = avro_value_to_beam_value(beam_type.map_type.value_type)\n    return lambda value: {k: value_converter(v) for (k, v) in value.items()}\n  elif type_info == \"row_type\":\n    converters = {\n        field.name: avro_value_to_beam_value(field.type)\n        for field in beam_type.row_type.schema.fields\n    }\n    return lambda value: beam.Row(\n        **\n        {name: convert(value[name])\n         for (name, convert) in converters.items()})\n  elif type_info == \"logical_type\":\n    return lambda value: value\n  else:\n    raise ValueError(f\"Unrecognized type_info: {type_info!r}\")\n\n\ndef beam_schema_to_avro_schema(\n    beam_schema: schema_pb2.Schema) -> _AvroSchemaType:\n  return beam_type_to_avro_type(\n      schema_pb2.FieldType(row_type=schema_pb2.RowType(schema=beam_schema)))\n\n\ndef unnest_primitive_type(beam_type: schema_pb2.FieldType):\n  \"\"\"unnests beam types that map to avro primitives or unions.\n      \n      if mapping to a avro primitive or a union, don't nest the field type\n      for complex types, like arrays, we need to nest the type.\n      Example: { 'type': 'string' } -> 'string'\n      { 'type': 'array', 'items': 'string' } \n      -> { 'type': 'array', 'items': 'string' }\n\n      Args:","sourceCodeStart":665,"sourceCodeEnd":701,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/io/avroio.py#L665-L701","documentation":"avroio.avro_value_to_beam_value dispatches on type_info, an internal classification derived from the Beam FieldType (atomic, array, map, row, logical, etc.). If the classification string does not match any handled branch, the function raises ValueError naming the unrecognized type_info, which normally indicates an internal bug or an unsupported/unknown FieldType.","triggerScenarios":"Calling avro_value_to_beam_value (via avro_dict_to_beam_row) with a Beam FieldType whose computed type_info is not one of the implemented branches — e.g. unusual field types or a Beam version where classification logic changed.","commonSituations":"Rare FieldType combinations from programmatic schema construction; schema protos from a newer/older Beam version whose types this avroio converter does not recognize; passing a FieldType that resolves to None/unexpected type_info.","solutions":["Inspect the Beam schema's field types and replace unsupported field types with basic ones (atomic, array, map, row)","Upgrade apache-beam — newer releases cover more field types in the converter","Construct your rows with beam.Row / manual Map instead of avro_dict_to_beam_row for exotic types","File a Beam issue with the schema proto if type_info is genuinely unrecognized for a standard type"],"exampleFix":"// before\nfield_type = schema_pb2.FieldType(row_type=schema_pb2.RowType())  # malformed row type\nc = avroio.avro_value_to_beam_value(field_type)  # ValueError: Unrecognized type_info\n// after\nfield_type = schema_pb2.FieldType(atomic_type=schema_pb2.STRING)\nc = avroio.avro_value_to_beam_value(field_type)","handlingStrategy":"try-catch","validationCode":"# preflight: convert a sample row before running the pipeline\nsample = next(iter(pcoll))\navroio.avro_dict_to_beam_row(sample, beam_schema)","typeGuard":null,"tryCatchPattern":"try:\n    row = avroio.avro_dict_to_beam_row(d, beam_schema)\nexcept ValueError as e:\n    logging.error('unsupported field type in schema: %s', e)\n    row = None  # skip or route to a dead-letter output","preventionTips":["Run a conversion smoke test over a sample record before production runs","Keep Beam versions consistent between schema producers and the avroio converter","Route unsupported-type records to a dead-letter PCollection instead of failing the job"],"tags":["python","apache-beam","avro","schema","conversion"],"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-14T16:17:12.679Z"}