From b7fcd3cc061295f16e4fc393b1270d1e0828e154 Mon Sep 17 00:00:00 2001 From: Thomas Fillon Date: Mon, 15 Sep 2014 12:39:14 +0200 Subject: [PATCH] fix(analyzer.core): return an Error if duplicate result ids are in the results container --- timeside/analyzer/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/timeside/analyzer/core.py b/timeside/analyzer/core.py index 23954a6..fe09dbd 100644 --- a/timeside/analyzer/core.py +++ b/timeside/analyzer/core.py @@ -943,9 +943,12 @@ class AnalyzerResultContainer(dict): self.__setitem__(res_uuid, analyzer_result) def get_result_by_id(self, result_id): + if self.list_id().count(result_id) > 1: + raise ValueError('Result id shared by several procesors in the pipe. Get result from the processor instead') for res in self.values(): if res.id_metadata.id == result_id: return res + raise KeyError('No such result id: %s' % result_id) def list_id(self): return [res.id for res in self.values()] -- 2.39.5