We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
_job
make
1 parent 18727e9 commit efbb920Copy full SHA for efbb920
1 file changed
datajoint/autopopulate.py
@@ -477,6 +477,18 @@ def _populate1(
477
datetime.datetime.utcnow() - make_start
478
).total_seconds(),
479
)
480
+ # Update the _job column with the job metadata for newly populated entries
481
+ if "_job" in self.target.heading._attributes:
482
+ job_metadata = {
483
+ "execution_time": make_start,
484
+ "execution_duration": (datetime.datetime.utcnow() - make_start).total_seconds(),
485
+ "host": platform.node(),
486
+ "pid": os.getpid(),
487
+ "connection_id": self.connection.connection_id,
488
+ "user": self._Jobs._user,
489
+ }
490
+ for k in (self.target & key).fetch("KEY"):
491
+ self.target.update1({**k, "_job": job_metadata})
492
493
logger.debug(f"Success making {key} -> {self.target.full_table_name}")
494
return True
0 commit comments