|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
from __future__ import (absolute_import, division, print_function,
|
|
|
|
|
unicode_literals)
|
|
|
|
|
|
|
|
|
|
import types
|
|
|
|
|
import inspect
|
|
|
|
|
import warnings
|
|
|
|
|
from functools import partial
|
|
|
|
@ -107,6 +108,8 @@ class Job(object):
|
|
|
|
|
raise TypeError('{0!r} is not a valid args list.'.format(args))
|
|
|
|
|
if not isinstance(kwargs, dict):
|
|
|
|
|
raise TypeError('{0!r} is not a valid kwargs dict.'.format(kwargs))
|
|
|
|
|
if not isinstance(job_id, (str, unicode, types.NoneType)):
|
|
|
|
|
raise TypeError('job_id must be a str/unicode, not {}.'.format(type(job_id)))
|
|
|
|
|
|
|
|
|
|
job = cls(connection=connection)
|
|
|
|
|
if job_id is not None:
|
|
|
|
@ -329,11 +332,7 @@ class Job(object):
|
|
|
|
|
|
|
|
|
|
def set_id(self, value):
|
|
|
|
|
"""Sets a job ID for the given job."""
|
|
|
|
|
try:
|
|
|
|
|
self.key_for(text_type(value))
|
|
|
|
|
except:
|
|
|
|
|
raise ValueError("Job ID invalid, failed to encode to string")
|
|
|
|
|
self._id = text_type(value)
|
|
|
|
|
self._id = value
|
|
|
|
|
|
|
|
|
|
id = property(get_id, set_id)
|
|
|
|
|
|
|
|
|
|