Skip to content

Commit b396954

Browse files
committed
reset priority for each condition
Increment the priority for each subsequent table to ensure they are inserted in the correct order
1 parent a2fd647 commit b396954

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ethopy/core/experiment.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ def log_conditions(
563563

564564
processed_conditions = conditions.copy()
565565
for condition in processed_conditions:
566+
_priority = priority
566567
# insert conditions fields to the correspond table
567568
for ctable in condition_tables:
568569
# Get table metadata
@@ -596,17 +597,17 @@ def log_conditions(
596597
table=ctable,
597598
tuple=cond_key,
598599
schema=schema,
599-
priority=priority,
600+
priority=_priority,
600601
)
601602

602603
else:
603604
self.logger.put(
604-
table=ctable, tuple=condition, schema=schema, priority=priority
605+
table=ctable, tuple=condition, schema=schema, priority=_priority
605606
)
606607

607608
# Increment the priority for each subsequent table
608609
# to ensure they are inserted in the correct order
609-
priority += 1
610+
_priority += 1
610611

611612
return processed_conditions
612613

0 commit comments

Comments
 (0)