From 711daa3a5dd6aee74b03dc1a93277a9ba3b38fd7 Mon Sep 17 00:00:00 2001 From: Jose Gracia Date: Wed, 21 Feb 2024 14:58:35 +0100 Subject: [PATCH] Intercept empty query resutls --- monitoring/db/scripts/get_detailed_power.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monitoring/db/scripts/get_detailed_power.py b/monitoring/db/scripts/get_detailed_power.py index 7fce31b..cc7c236 100755 --- a/monitoring/db/scripts/get_detailed_power.py +++ b/monitoring/db/scripts/get_detailed_power.py @@ -84,6 +84,8 @@ class Power: @classmethod def from_db(cls, db, jobid, interval, hawk_ai): df = db.db_to_pf(jobid, interval, hawk_ai) + if df.empty: + raise RuntimeError power = cls.from_pandas(df, {'time': 'time', 'name': 'node', 'avg': 'power'}) return power