m3dev / gokart

Gokart solves reproducibility, task dependencies, constraints of good code, and ease of use for Machine Learning Pipeline.
https://gokart.readthedocs.io/en/latest/
MIT License
318 stars 57 forks source link

IntParameter `TaskOnKart.fix_random_seed_value` cannnot handle None #286

Closed Hi-king closed 2 years ago

Hi-king commented 2 years ago

Following code reproduces the error.

class EachTask(gokart.TaskOnKart):
    serialized_task_definition_check = True
    user = luigi.IntParameter()

    def run(self):
        print(self.user)
        self.dump(self.user)

class RunTask(gokart.TaskOnKart):
    serialized_task_definition_check = True
    def run(self):
        for i in range(5):
            done = yield EachTask(user=i)
            print("result", self.load(done))
        self.dump("done")

gokart.build(RunTask(), log_level=logging.INFO, reset_register=False)

ValueError: invalid literal for int() with base 10: 'None'

Hi-king commented 2 years ago

Need OptionalIntParameter, which is very recent and not released feature 😿

https://github.com/spotify/luigi/pull/3079