Fixed a couple corner cases in scripts when fields are empty

- Fixed added/removed count in scripts when an entry has no field in
  the expected results

- Fixed a python-sort-type issue when by-field is missing in a result
This commit is contained in:
Christopher Haster
2022-11-19 01:43:28 -06:00
parent 0b11ce03b7
commit 387cf6f6e0
8 changed files with 46 additions and 1 deletions

View File

@@ -1012,6 +1012,9 @@ def report(obj_path='', trace_paths=[], *,
with openio(args['use']) as f:
reader = csv.DictReader(f, restval='')
for r in reader:
if not any('perfbd_'+k in r and r['perfbd_'+k].strip()
for k in PerfBdResult._fields):
continue
try:
results.append(PerfBdResult(
**{k: r[k] for k in PerfBdResult._by
@@ -1053,6 +1056,9 @@ def report(obj_path='', trace_paths=[], *,
with openio(args['diff']) as f:
reader = csv.DictReader(f, restval='')
for r in reader:
if not any('perfbd_'+k in r and r['perfbd_'+k].strip()
for k in PerfBdResult._fields):
continue
try:
diff_results.append(PerfBdResult(
**{k: r[k] for k in PerfBdResult._by