{"record":{"id":"185f4417143b19ed","repo":"apache/beam","slug":"unrecognized-type-info-type-info-r-yaml-mapping","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/yaml/yaml_mapping.py","lineNumber":366,"sourceCode":"    return lambda value: all(element_validator(e) for e in value)\n  elif type_info == \"iterable_type\":\n    element_validator = _validator(beam_type.iterable_type.element_type)\n    return lambda value: all(element_validator(e) for e in value)\n  elif type_info == \"map_type\":\n    key_validator = _validator(beam_type.map_type.key_type)\n    value_validator = _validator(beam_type.map_type.value_type)\n    return lambda value: all(\n        key_validator(k) and value_validator(v) for (k, v) in value.items())\n  elif type_info == \"row_type\":\n    validators = {\n        field.name: _validator(field.type)\n        for field in beam_type.row_type.schema.fields\n    }\n    return lambda row: all(\n        validator(getattr(row, name))\n        for (name, validator) in validators.items())\n  else:\n    raise ValueError(f\"Unrecognized type_info: {type_info!r}\")\n\n\ndef _as_callable_for_pcoll(\n    pcoll,\n    fn_spec: Union[str, dict[str, str]],\n    msg: str,\n    language: Optional[str]):\n  if language == 'javascript':\n    options.YamlOptions.check_enabled(pcoll.pipeline, 'javascript')\n\n  try:\n    input_schema = dict(named_fields_from_element_type(pcoll.element_type))\n  except (TypeError, ValueError) as exn:\n    if is_expr(fn_spec):\n      raise ValueError(\"Can only use expressions on a schema'd input.\") from exn\n    input_schema = {}  # unused\n\n  if isinstance(fn_spec, str) and fn_spec in input_schema:","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_mapping.py#L348-L384","documentation":"`_validator` dispatches on the FieldType's `type_info` oneof (atomic_type, array_type, iterable_type, map_type, row_type). If the oneof is unset or set to something else (e.g. an empty/default FieldType or logical_type), the recursion falls through to this ValueError.","triggerScenarios":"An output_type or schema-derived Beam type that yields a FieldType with no recognized type_info, e.g. a null_type / logical_type field reached during recursive validation of arrays, maps, or rows, or an empty dict passed as output_type.","commonSituations":"Declaring nested output_type structures with missing 'element_type'/'value_type' keys, passing an empty output_type dict, or schemas containing logical types that _validator doesn't model.","solutions":["Check the output_type spec for malformed nested entries (missing element_type for arrays, key/value types for maps).","Restrict output_type declarations to types _validator supports: atomic types, arrays, iterables, maps, and nested rows.","If a logical/null type is needed, extend _validator in yaml_mapping.py to handle that type_info."],"exampleFix":"# before\noutput_type:\n  type: array\n# after\noutput_type:\n  type: array\n  element_type: string","handlingStrategy":"validation","validationCode":"def check_type_spec(spec):\n    if isinstance(spec, dict) and 'type' in spec:\n        if spec['type'] in ('array', 'iterable'):\n            assert 'element_type' in spec or 'items' in spec\n        if spec['type'] == 'map':\n            assert 'key_type' in spec and 'value_type' in spec","typeGuard":"def is_complete_type_spec(spec: dict) -> bool:\n    if not isinstance(spec, dict) or 'type' not in spec:\n        return False\n    return spec['type'] not in ('array', 'map') or (\n        'element_type' in spec or ('key_type' in spec and 'value_type' in spec))","tryCatchPattern":"try:\n    run_pipeline(yaml_spec)\nexcept ValueError as e:\n    if 'Unrecognized type_info' in str(e):\n        raise ConfigError('malformed output_type spec') from e","preventionTips":["Fully specify nested types (element_type for arrays, key/value types for maps)","Avoid empty output_type dicts","Avoid logical/null types in output_type declarations"],"tags":["yaml","beam-yaml","schema","type-validation"],"backgroundTag":"schema-validation-failed","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"}