m3dev/kannon

All parameters of the child bullet task are `str`

yokomotod opened this issue · 1 comments

When launch this task as child job,

class Example(kannon.TaskOnBullet):
     a = luigi.Parameter(default=None)
     b = luigi.Parameter(default=1)
     c = luigi.Parameter(default='foo')

at child script,

task = gokart.TaskInstanceParameter().parse(serialized_task)

it seems that all deserialized parameters are str

>>> task.a
'None'
>>> task.b
'1'
>>> task.c
'foo'

This could be a bug in gokart.

import luigi
import gokart

class Example(gokart.TaskOnKart):
     a = luigi.Parameter(default=None)
     b = luigi.Parameter(default=1)
     c = luigi.Parameter(default='foo')

task = gokart.TaskInstanceParameter().parse(gokart.TaskInstanceParameter().serialize(Example()))

(task.a, task.b, task.c). # => ('None', '1', 'foo')