Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove the missing branches after the loop #105

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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