You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As it is, the return type for get_status is Union[JobStatus, str, None]. This results in an error if you expect an Enum and call Job.get_status().value.
I believe the return type annotations in line 325 and 332 should be Optional[JobStatus] and line 336 should be updated to self._status = JobStatus(as_text(status)) if status else None.
refresh (bool, optional): Whether to refresh the Job. Defaults to True.
Returns:
status (JobStatus): The Job Status
"""
ifrefresh:
status=self.connection.hget(self.key, 'status')
self._status=as_text(status) ifstatuselseNone
returnself._status
Also line 950 in Job.restore should probably be self._status = JobStatus(as_text(obj.get('status'))) if obj.get('status') else None for consistency and so that it doesn't set Job._status to a string.
As it is, the return type for
get_status
isUnion[JobStatus, str, None]
. This results in an error if you expect an Enum and callJob.get_status().value
.I believe the return type annotations in line 325 and 332 should be
Optional[JobStatus]
and line 336 should be updated toself._status = JobStatus(as_text(status)) if status else None
.rq/rq/job.py
Lines 325 to 337 in 2f5fecc
Also line 950 in
Job.restore
should probably beself._status = JobStatus(as_text(obj.get('status'))) if obj.get('status') else None
for consistency and so that it doesn't setJob._status
to a string.rq/rq/job.py
Line 950 in 2f5fecc
I also noticed that the docstring for the
as_text
function is inconsistent, it should probably sayvalue (str): The decoded string
.rq/rq/utils.py
Lines 41 to 52 in 2f5fecc
The text was updated successfully, but these errors were encountered: