Skip to content

Instantly share code, notes, and snippets.

@r-wheeler
Created January 16, 2015 15:13
Show Gist options
  • Save r-wheeler/ee4e7fb03e6ca3412ec9 to your computer and use it in GitHub Desktop.
Save r-wheeler/ee4e7fb03e6ca3412ec9 to your computer and use it in GitHub Desktop.
Global Params for Luigi
class FooParamsMixin(object):
param1 = luigi.Parameter()
param2 = luigi.Parameter()
...
def foo_params(self):
return { 'param1': self.param1, 'param2' : self.param2, ... }
class TaskA(FooParamsMixin, luigi.Task):
def requires(self):
return TaskB(**self.foo_params(), # plus any other params)
class TaskB(FooParamsMixin, luigi.Task):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment