Created
January 16, 2015 15:13
-
-
Save r-wheeler/ee4e7fb03e6ca3412ec9 to your computer and use it in GitHub Desktop.
Global Params for Luigi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
https://groups.google.com/forum/#!msg/luigi-user/7zIS_qseNOM/TWcYtRe5SVoJ )