Exemple #1
0
        class TTaskMultipleOutputs(TTask):
            t_types = parameter(default=[1, 2])[List]
            t_output = output.folder(output_factory=_partitions)

            def run(self):
                for t_name, t_target in six.iteritems(self.t_output):
                    t_target.write("%s" % t_name)
Exemple #2
0
        class TTaskMultipleOutputs(TTask):
            t_types = parameter.value([1, 2])
            t_output = output.folder()

            def band(self):
                root = self.__class__.t_output.build_output(self)
                self.t_output = {
                    t: root.partition(name="t_output/%s" % t)
                    for t in self.t_types
                }

            def run(self):
                for t_name, t_target in six.iteritems(self.t_output):
                    t_target.write("%s" % t_name)
Exemple #3
0
class TProdImmutbaleOutputs(PythonTask):
    splits = output.folder(output_mode=OutputMode.prod_immutable).target

    def run(self):
        self.splits.write("a")