luigi.contrib.redis_store
Classes
|
Target for a resource in Redis. |
- class luigi.contrib.redis_store.RedisTarget(host, port, db, update_id, password=None, socket_timeout=None, expire=None)[source]
Target for a resource in Redis.
- Parameters:
host (str) – Redis server host
port (int) – Redis server port
db (int) – database index
update_id (str) – an identifier for this data hash
password (str) – a password to connect to the redis server
socket_timeout (int) – client socket timeout
expire (int) – timeout before the target is deleted
- marker_prefix
Parameter whose value is a
str, and a base class for other parameter types.Parameters are objects set on the Task class level to make it possible to parameterize tasks. For instance:
class MyTask(luigi.Task): foo = luigi.Parameter() class RequiringTask(luigi.Task): def requires(self): return MyTask(foo="hello") def run(self): print(self.requires().foo) # prints "hello"
This makes it possible to instantiate multiple tasks, eg
MyTask(foo='bar')andMyTask(foo='baz'). The task will then have thefooattribute set appropriately.When a task is instantiated, it will first use any argument as the value of the parameter, eg. if you instantiate
a = TaskA(x=44)thena.x == 44. When the value is not provided, the value will be resolved in this order of falling priority:Any value provided on the command line:
To the root task (eg.
--param xyz)Then to the class, using the qualified task name syntax (eg.
--TaskA-param xyz).
With
[TASK_NAME]>PARAM_NAME: <serialized value>syntax. See Parameters from config IngestionAny default value set using the
defaultflag.
Parameter objects may be reused, but you must then set the
positional=Falseflag.