Skip to content

Commit

Permalink
[IMP] queue_job: Add split method
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxxxzero authored and florentx committed Jan 13, 2025
1 parent 40f738d commit 18f5834
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions queue_job/delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def _ensure_same_graph_uuid(jobs):
elif jobs_count == 1:
if jobs[0].graph_uuid:
raise ValueError(
f"Job {jobs[0]} is a single job, it should not" " have a graph uuid"
f"Job {jobs[0]} is a single job, it should not have a graph uuid"
)
else:
graph_uuids = {job.graph_uuid for job in jobs if job.graph_uuid}
Expand Down Expand Up @@ -483,11 +483,10 @@ def _tail(self):
return [self]

def __repr__(self):
return "Delayable({}.{}({}, {}))".format(
self.recordset,
self._job_method.__name__ if self._job_method else "",
self._job_args,
self._job_kwargs,
return (
f"Delayable({self.recordset}."
f"{self._job_method.__name__ if self._job_method else ''}"
f"({self._job_args}, {self._job_kwargs}))"
)

def __del__(self):
Expand Down Expand Up @@ -656,9 +655,9 @@ def _delay_delayable(*args, **kwargs):
return _delay_delayable

def __str__(self):
return "DelayableRecordset({}{})".format(
self.delayable.recordset._name,
getattr(self.delayable.recordset, "_ids", ""),
return (
f"DelayableRecordset({self.delayable.recordset._name}"
f"{getattr(self.delayable.recordset, '_ids', '')})"
)

__repr__ = __str__

0 comments on commit 18f5834

Please sign in to comment.