Skip to content

Commit c736d2c

Browse files
modified the handling of key_source to allow populating across changes of primary key
1 parent 08c3931 commit c736d2c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

datajoint/autopopulate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def populate(self, *restrictions, suppress_errors=False, reserve_jobs=False, ord
7676
todo = self.key_source
7777
if not isinstance(todo, RelationalOperand):
7878
raise DataJointError('Invalid key_source value')
79-
todo &= AndList(restrictions)
79+
todo = todo.proj() & AndList(restrictions)
8080

8181
error_list = [] if suppress_errors else None
8282

@@ -89,7 +89,7 @@ def handler(signum, frame):
8989
raise SystemExit('SIGTERM received')
9090
old_handler = signal.signal(signal.SIGTERM, handler)
9191

92-
todo -= self.target.proj(*todo.primary_key)
92+
todo -= self.target
9393
keys = list(todo.fetch.keys())
9494
if order == "reverse":
9595
keys.reverse()
@@ -141,7 +141,7 @@ def progress(self, *restrictions, display=True):
141141
"""
142142
todo = self.key_source & AndList(restrictions)
143143
total = len(todo)
144-
remaining = len(todo - self.target.proj(*todo.primary_key))
144+
remaining = len(todo.proj() - self.target)
145145
if display:
146146
print('%-20s' % self.__class__.__name__,
147147
'Completed %d of %d (%2.1f%%) %s' % (

0 commit comments

Comments
 (0)