luigi.contrib.redis_store

Classes

RedisTarget(host, port, db, update_id[, ...])

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') and MyTask(foo='baz'). The task will then have the foo attribute 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) then a.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 Ingestion

  • Any default value set using the default flag.

Parameter objects may be reused, but you must then set the positional=False flag.

marker_key()[source]

Generate a key for the indicator hash.

touch()[source]

Mark this update as complete.

We index the parameters update_id and date.

exists()[source]

Test, if this task has been run.