From 23651714ae379d465c20629d27d2e57fec2dcf5e Mon Sep 17 00:00:00 2001 From: amirnd51 Date: Tue, 10 Sep 2024 18:36:29 +0000 Subject: [PATCH] Refactor create_trial function to handle source trials absence --- python_api/db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_api/db.py b/python_api/db.py index 44826d8..6454b5c 100644 --- a/python_api/db.py +++ b/python_api/db.py @@ -35,7 +35,7 @@ def create_trial( model_id, experiment_id, cur, conn,source_id="",completed_at=N if source_id!="": cur.execute("INSERT INTO trials (id,model_id,created_at,updated_at,completed_at,experiment_id,source_trial_id) VALUES (%s,%s,%s,%s,%s,%s,%s) RETURNING id", (trial_id,model_id, datetime.now(), datetime.now() ,datetime.now() , experiment_id,source_id)) else: - cur.execute("INSERT INTO trials (id,model_id,created_at,updated_at,experiment_id) VALUES (%s,%s,%s,%s) RETURNING id", (trial_id,model_id, datetime.now(), datetime.now() , experiment_id)) + cur.execute("INSERT INTO trials (id,model_id,created_at,updated_at,experiment_id) VALUES (%s,%s,%s,%s,%s) RETURNING id", (trial_id, model_id, datetime.now(), datetime.now() , experiment_id)) conn.commit() return trial_id