Skip to content

Commit

Permalink
remove the missing branches after the loop (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrpo committed Apr 28, 2024
1 parent da6d21d commit f0c0d12
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions report.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,22 @@
nsimulate = {}
exectime = {}

missing_branches = []
for branch in branches:
try:
cursor.execute("SELECT date FROM [%s] ORDER BY date DESC LIMIT 1" % branch)
one = cursor.fetchone()
if one == None:
print("No such table '%s'; specify it using --branch=XXX when running test.py" % branch)
# ignore this table and continue
branches.remove(branch)
missing_branches.append(branch)
continue
else:
v = one[0]
except:
print("No such table '%s'; specify it using --branch=XXX when running test.py" % branch)
# ignore this table and continue
branches.remove(branch)
missing_branches.append(branch)
continue

dates_str[branch] = str(datetime.datetime.fromtimestamp(v).strftime('%Y-%m-%d %H:%M:%S'))
Expand All @@ -78,6 +79,9 @@
exectime[branch] = 0.0

entries = ""
# removing missing branches
for branch in missing_branches:
branches.remove(branch)

def checkEqual(iterator):
return len(set(iterator)) <= 1
Expand Down

0 comments on commit f0c0d12

Please sign in to comment.