You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you have a task with a parameter that defaults to None, it converts to str("None") if the task is yielded from run(), but remains None if a task is returned from requires() method.
When I run the following code with luigi --module <module> YieldTask --local-scheduler, the file yield.txt contains <class 'str'>.
When I run the following code with luigi --module <module> ReturnTask --local-scheduler, the file return.txt contains <class 'NoneType'>.
import luigi
class ParamTask(luigi.Task):
none_param = luigi.Parameter(default=None)
name_param = luigi.Parameter()
def run(self):
with self.output().open('w') as f:
f.write(str(type(self.none_param)))
def output(self):
return luigi.LocalTarget(f'{self.name_param}.txt')
class YieldTask(luigi.Task):
def run(self):
yield ParamTask(name_param='yield')
class ReturnTask(luigi.Task):
def requires(self):
return ParamTask(name_param='return')
luigi version: 3.2.0
The text was updated successfully, but these errors were encountered:
When you have a task with a parameter that defaults to
None
, it converts tostr("None")
if the task is yielded fromrun()
, but remainsNone
if a task is returned fromrequires()
method.When I run the following code with
luigi --module <module> YieldTask --local-scheduler
, the fileyield.txt
contains<class 'str'>
.When I run the following code with
luigi --module <module> ReturnTask --local-scheduler
, the filereturn.txt
contains<class 'NoneType'>
.luigi version: 3.2.0
The text was updated successfully, but these errors were encountered: