{"record":{"id":"6bc950e0ba12d2f4","repo":"apache/beam","slug":"f-attr-type-ix-of-test-specification-identifier-must-be-an","errorCode":null,"errorMessage":"f'{attr_type} {ix} of test specification {identifier} must be an object, got {type(attr_item)}'","messagePattern":"f'(.+?) (.+?) of test specification (.+?) must be an object, got (.+?)'","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_testing.py","lineNumber":184,"sourceCode":"          'allowed_sources',\n      ])\n  if unknown_attrs:\n    raise ValueError(\n        f'test specification {identifier} '\n        f'has unknown attributes {list(unknown_attrs)}')\n\n  for attr_type in ('mock_inputs',\n                    'mock_outputs',\n                    'expected_outputs',\n                    'expected_inputs'):\n    attr = test_spec.get(attr_type, [])\n    if not isinstance(attr, list):\n      raise TypeError(\n          f'{attr_type} of test specification {identifier} '\n          f'must be a list, got {type(attr_type)}')\n    for ix, attr_item in enumerate(attr):\n      if not isinstance(attr_item, dict):\n        raise TypeError(\n            f'{attr_type} {ix} of test specification {identifier} '\n            f'must be an object, got {type(attr_item)}')\n      if 'name' not in attr_item:\n        raise TypeError(\n            f'{attr_type} {ix} of test specification {identifier} '\n            f'missing a name')\n      if 'elements' not in attr_item:\n        raise TypeError(\n            f'{attr_type} {ix} of test specification {identifier} '\n            f'missing a elements')\n      if not isinstance(attr_item['elements'], list):\n        raise TypeError(\n            f'{attr_type} {ix} of test specification {identifier} '\n            f'must be a list, got {type(attr_item[\"elements\"])}')\n\n\ndef inject_test_tranforms(spec, test_spec, fix_failures):\n  validate_test_spec(test_spec)","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_testing.py#L166-L202","documentation":"One entry inside a mock_inputs/mock_outputs/expected_outputs/expected_inputs list is not a mapping. Each entry must be an object with at least a 'name' key and an 'elements' key; this guard fires when an entry (e.g. a bare string or number) cannot be treated as a per-input/output spec.","triggerScenarios":"Thrown at sdks/python/apache_beam/yaml/yaml_testing.py:184 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make each list entry a mapping with 'name' and 'elements' keys, e.g. {name: input1, elements: [...]}","Quote names that could be parsed as scalars and ensure YAML indentation places entries under the attribute list"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}