From a51e342328b9e6d4cee9da36b24347a86e8a6467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sj=C3=B6lund?= Date: Sat, 31 Oct 2026 21:25:12 +0100 Subject: [PATCH] report.py: look a branch up with tableExists A branch with no table yet, such as master-fmi-cs-cvode before its first run, was found by querying it and catching the error. On PostgreSQL that error aborts the transaction, so the next query failed with InFailedSqlTransaction and the report was never written. Ask tableExists first, as the other report scripts do. Assisted-by: Claude Opus 5.5 --- report.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/report.py b/report.py index 00e3568..cad20c8 100755 --- a/report.py +++ b/report.py @@ -44,21 +44,15 @@ missing_branches = [] for branch in branches: - try: + one = None + if db.tableExists(branch): cursor.execute("SELECT date FROM %s ORDER BY date DESC LIMIT 1" % db.quote(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 - missing_branches.append(branch) - continue - else: - v = one[0] - except: + if one is None: print("No such table '%s'; specify it using --branch=XXX when running test.py" % branch) - # ignore this table and continue missing_branches.append(branch) continue + v = one[0] dates_str[branch] = str(datetime.datetime.fromtimestamp(v).strftime('%Y-%m-%d %H:%M:%S')) db.createDateIndex(branch)