{"record":{"id":"593d74f12a4c112c","repo":"apache/beam","slug":"f-attr-type-ix-of-test-specification-identifier-missing-a-593d74","errorCode":null,"errorMessage":"f'{attr_type} {ix} of test specification {identifier} missing a elements'","messagePattern":"f'(.+?) (.+?) of test specification (.+?) missing a elements'","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_testing.py","lineNumber":192,"sourceCode":"                    '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)\n  scope = yaml_transform.LightweightScope(spec['transforms'])\n\n  mocked_inputs_by_id = {\n      scope.get_transform_id(mock_input['name']): mock_input\n      for mock_input in test_spec.get('mock_inputs', [])\n  }\n\n  mocked_outputs_by_id = _composite_key_to_nested({","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_testing.py#L174-L210","documentation":"An entry in mock_inputs/mock_outputs/expected_outputs/expected_inputs has a 'name' but no 'elements' key. The elements list holds the sample or expected rows for that input/output; without it the test has nothing to inject or assert, so validation fails. Note the message says 'a elements' due to an interpolation typo in the format string.","triggerScenarios":"Thrown at sdks/python/apache_beam/yaml/yaml_testing.py:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add an 'elements' key containing the list of rows for that input/output, e.g. elements: [{id: 1}]","Use elements: [] to explicitly assert an empty output"],"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"}