Skip to content

Commit

Permalink
chore: Use model copies instead of copy; as copy will be deprecated b…
Browse files Browse the repository at this point in the history
…y pydantic
  • Loading branch information
provos committed Sep 5, 2024
1 parent 317abcc commit 05959f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/planai/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def _execute_task(self, worker: TaskWorker, task: Task):
try:
# since we are storing a lot of references to the task, we need to make sure
# that we are not storing the same task object in multiple places
worker._pre_consume_work(task.copy())
worker._pre_consume_work(task.model_copy())
except Exception:
raise # Re-raise the caught exception
finally:
Expand Down Expand Up @@ -409,7 +409,7 @@ def _task_completed(self, worker: TaskWorker, task: Optional[Task], future):
self.task_completion_event.set()

def add_work(self, worker: TaskWorker, task: Task):
task_copy = task.copy()
task_copy = task.model_copy()
self._add_provenance(task_copy)
self.work_queue.put((worker, task_copy))

Expand Down

0 comments on commit 05959f2

Please sign in to comment.