Intercept empty query resutls
This commit is contained in:
parent
c2b5732be8
commit
711daa3a5d
1 changed files with 2 additions and 0 deletions
|
@ -84,6 +84,8 @@ class Power:
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_db(cls, db, jobid, interval, hawk_ai):
|
def from_db(cls, db, jobid, interval, hawk_ai):
|
||||||
df = db.db_to_pf(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'})
|
power = cls.from_pandas(df, {'time': 'time', 'name': 'node', 'avg': 'power'})
|
||||||
|
|
||||||
return power
|
return power
|
||||||
|
|
Loading…
Reference in a new issue