{"record":{"id":"d069b11da4407d03","repo":"deepset-ai/haystack","slug":"the-other-parameter-must-have-run-name-input","errorCode":null,"errorMessage":"The 'other' parameter must have 'run_name', 'inputs', and 'results' attributes.","messagePattern":"The 'other' parameter must have 'run_name', 'inputs', and 'results' attributes\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"haystack/evaluation/eval_run_result.py","lineNumber":192,"sourceCode":"\n        :param other: Results of another evaluation run to compare with.\n        :param keep_columns: List of common column names to keep from the inputs of the evaluation runs to compare.\n        :param output_format: The output format for the report, \"json\", \"csv\", or \"df\", default to \"json\".\n        :param csv_file: Filepath to save CSV output if `output_format` is \"csv\", must be provided.\n\n        :returns:\n            JSON or DataFrame with a comparison of the detailed scores, in case the output is set to a CSV file,\n             a message confirming the successful write or an error message.\n        :raises TypeError: If `other` is not an EvaluationRunResult instance, or if the detailed reports are not\n            dictionaries.\n        :raises ValueError: If the `other` parameter is missing required attributes.\n        \"\"\"\n\n        if not isinstance(other, EvaluationRunResult):\n            raise TypeError(\"Comparative scores can only be computed between EvaluationRunResults.\")\n\n        if not hasattr(other, \"run_name\") or not hasattr(other, \"inputs\") or not hasattr(other, \"results\"):\n            raise ValueError(\"The 'other' parameter must have 'run_name', 'inputs', and 'results' attributes.\")\n\n        if self.run_name == other.run_name:\n            logger.warning(\n                \"The run names of the two evaluation results are the same ('{run_name}')\", run_name=self.run_name\n            )\n\n        if self.inputs.keys() != other.inputs.keys():\n            logger.warning(\n                \"The input columns differ between the results; using the input columns of '{run_name}'\",\n                run_name=self.run_name,\n            )\n\n        # got both detailed reports\n        detailed_a = self.detailed_report(output_format=\"json\")\n        detailed_b = other.detailed_report(output_format=\"json\")\n\n        # ensure both detailed reports are in dictionaries format\n        if not isinstance(detailed_a, dict) or not isinstance(detailed_b, dict):","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/evaluation/eval_run_result.py#L174-L210","documentation":"After the isinstance check, comparative_detailed_report verifies the other object exposes run_name, inputs, and results attributes. A subclass or mock missing any of these raises this ValueError, since the comparison needs the other run's inputs and per-metric results.","triggerScenarios":"Passing an EvaluationRunResult subclass or stub/mock that does not define run_name, inputs, or results — typically a hand-rolled fake in tests.","commonSituations":"Test doubles that only implement part of the API; a subclass that renamed attributes; pickled objects from an older haystack version with a different attribute layout.","solutions":["Ensure the other object defines all three attributes: run_name, inputs, results.","Replace partial mocks with real EvaluationRunResult instances in tests.","Update old serialized results to the current attribute schema."],"exampleFix":"// before\nclass FakeRun:\n    run_name = 'b'\nrun_a.comparative_detailed_report(other=FakeRun())\n// after\nclass FakeRun:\n    run_name = 'b'\n    inputs = {...}\n    results = {...}\nrun_a.comparative_detailed_report(other=FakeRun())","handlingStrategy":"type-guard","validationCode":"required = ('run_name', 'inputs', 'results')\nif not all(hasattr(other, a) for a in required):\n    raise ValueError(f'other must define {required}')","typeGuard":"def is_complete_run(obj: object) -> bool:\n    return all(hasattr(obj, a) for a in ('run_name', 'inputs', 'results'))","tryCatchPattern":"try:\n    comparison = run_a.comparative_detailed_report(other=other)\nexcept ValueError as e:\n    if \"must have 'run_name'\" in str(e):\n        raise TypeError(f'{type(other).__name__} is not a usable evaluation run') from e\n    raise","preventionTips":["Avoid partial mocks/stubs of EvaluationRunResult in tests","Subclasses must not rename the run_name/inputs/results attributes","Validate the schema of unpickled/loaded result objects"],"tags":["python","attribute-validation","evaluation"],"backgroundTag":"missing-required-field","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}