diff --git a/datajoint/autopopulate.py b/datajoint/autopopulate.py index 4f2a5f22..0e16ee29 100644 --- a/datajoint/autopopulate.py +++ b/datajoint/autopopulate.py @@ -23,7 +23,7 @@ def _initialize_populate(table, jobs, populate_kwargs): """ - Initialize the process for mulitprocessing. + Initialize the process for multiprocessing. Saves the unpickled copy of the table to the current process and reconnects. """ process = mp.current_process() @@ -153,6 +153,7 @@ def _jobs_to_do(self, restrictions): def populate( self, *restrictions, + keys=None, suppress_errors=False, return_exception_objects=False, reserve_jobs=False, @@ -169,6 +170,8 @@ def populate( :param restrictions: a list of restrictions each restrict (table.key_source - target.proj()) + :param keys: The list of keys (dicts) to send to self.make(). + If None (default), then use self.key_source to query they keys. :param suppress_errors: if True, do not terminate execution. :param return_exception_objects: return error objects instead of just error messages :param reserve_jobs: if True, reserve jobs to populate in asynchronous fashion @@ -206,7 +209,10 @@ def handler(signum, frame): old_handler = signal.signal(signal.SIGTERM, handler) - keys = (self._jobs_to_do(restrictions) - self.target).fetch("KEY", limit=limit) + if keys is None: + keys = (self._jobs_to_do(restrictions) - self.target).fetch( + "KEY", limit=limit + ) # exclude "error", "ignore" or "reserved" jobs if reserve_jobs: @@ -295,6 +301,7 @@ def _populate1( :return: (key, error) when suppress_errors=True, True if successfully invoke one `make()` call, otherwise False """ + # use the legacy `_make_tuples` callback. make = self._make_tuples if hasattr(self, "_make_tuples") else self.make if jobs is not None and not jobs.reserve( diff --git a/datajoint/table.py b/datajoint/table.py index 96e38082..1ad4177a 100644 --- a/datajoint/table.py +++ b/datajoint/table.py @@ -644,6 +644,8 @@ def cascade(table): logger.warn("Nothing to delete.") if transaction: self.connection.cancel_transaction() + elif not transaction: + logger.info("Delete completed") else: if not safemode or user_choice("Commit deletes?", default="no") == "yes": if transaction: