From 53241478c822dc48d76f277a6bb91d8ca77e276a Mon Sep 17 00:00:00 2001 From: prazumovsky Date: Wed, 15 Jan 2020 17:10:07 +0400 Subject: [PATCH] Fix incorrect __round__ behaviour In some cases with large scenario parameters, __round__ raises an error: TypeError: type NoneType doesn't define __round__ method Fix __round__ behaviour for StreamingAlgorithm ins == None. Change-Id: I33acb494ddabc6855bd73868ebf8cbeee43bab86 --- rally/task/processing/charts.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rally/task/processing/charts.py b/rally/task/processing/charts.py index eabffab70d..3391e3fca5 100644 --- a/rally/task/processing/charts.py +++ b/rally/task/processing/charts.py @@ -330,7 +330,11 @@ class Table(Chart): :returns: rounded float :returns: str "n/a" """ - return round(ins.result(), 3) if has_result else "n/a" + r = ins.result() + if not has_result or r is None: + return "n/a" + else: + return round(r, 3) def _row_has_results(self, values): """Determine whether row can be assumed as having values.