MCPcopy
hub / github.com/treeverse/dvc / celery_remove

Function celery_remove

dvc/repo/experiments/queue/remove.py:112–142  ·  view source on GitHub ↗

Remove the specified entries from the queue. Arguments: revs: Stash revisions or queued exp names to be removed. Returns: Revisions (or names) which were removed.

(self: "LocalCeleryQueue", revs: Collection[str])

Source from the content-addressed store, hash-verified

110
111
112def celery_remove(self: "LocalCeleryQueue", revs: Collection[str]) -> list[str]:
113 """Remove the specified entries from the queue.
114
115 Arguments:
116 revs: Stash revisions or queued exp names to be removed.
117
118 Returns:
119 Revisions (or names) which were removed.
120 """
121
122 match_results = self.match_queue_entry_by_name(
123 revs, self.iter_queued(), self.iter_done()
124 )
125
126 remained: list[str] = []
127 removed: list[str] = []
128 entry_to_remove: list[QueueEntry] = []
129 for name, entry in match_results.items():
130 if entry:
131 entry_to_remove.append(entry)
132 removed.append(name)
133 else:
134 remained.append(name)
135
136 if remained:
137 raise UnresolvedExpNamesError(remained)
138
139 if entry_to_remove:
140 remove_tasks(self, entry_to_remove)
141
142 return removed

Callers 1

removeMethod · 0.85

Calls 7

remove_tasksFunction · 0.85
itemsMethod · 0.80
appendMethod · 0.80
iter_queuedMethod · 0.45
iter_doneMethod · 0.45

Tested by

no test coverage detected