Skip to content

Commit e0d6fd9

Browse files
committed
Simplify: use self.proj() for jobs table projections
1 parent 34c302a commit e0d6fd9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/datajoint/jobs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def refresh(
265265
# Project to FK-derived attributes only
266266
key_source_proj = key_source.proj(*pk_attrs)
267267
target_proj = self._target.proj(*pk_attrs)
268-
existing_jobs = self.proj(*pk_attrs)
268+
existing_jobs = self.proj() # jobs table PK is the FK-derived attrs
269269

270270
# Keys that need jobs: in key_source, not in target, not already in jobs
271271
new_keys = (key_source_proj - target_proj - existing_jobs).fetch("KEY")
@@ -285,7 +285,7 @@ def refresh(
285285
removed = 0
286286
if stale_timeout > 0:
287287
stale_condition = f'status="pending" AND ' f"created_time < NOW() - INTERVAL {stale_timeout} SECOND"
288-
stale_jobs = (self & stale_condition).proj(*pk_attrs)
288+
stale_jobs = (self & stale_condition).proj()
289289

290290
# Check which stale jobs are no longer in key_source
291291
orphaned_keys = (stale_jobs - key_source_proj).fetch("KEY")

0 commit comments

Comments
 (0)