In pipelines I've found that empty lists don't work as I would expect them to work. For example, this will work fine:
` from clearml.automation.controller import PipelineDecorator
@PipelineDecorator.component(cache=False)
def step_one():
my_list = [1, 2, 3, 4, 5]
return my_list
@PipelineDecorator.component(cache=False)
def step_two(some_list):
for i in some_list:
print(i)
@PipelineDecorator.pipeline(name='custom pipeline logic', project='examples', version='0.0.5')
def executing_pipeline():
my_list = step_one()
step_two(my_list)
if name == 'main':
PipelineDecorator.run_locally()
executing_pipeline() But now if I pass an empty list, like so:
from clearml.automation.controller import PipelineDecorator
@PipelineDecorator.component(cache=False)
def step_one():
my_list = []
return my_list
@PipelineDecorator.component(cache=False)
def step_two(some_list):
for i in some_list:
print(i)
@PipelineDecorator.pipeline(name='custom pipeline logic', project='examples', version='0.0.5')
def executing_pipeline():
my_list = step_one()
step_two(my_list)
if name == 'main':
PipelineDecorator.run_locally()
executing_pipeline() I get this error:
Traceback (most recent call last):
File "/tmp/tmpg46c1ntq.py", line 25, in <module>
results = step_two(**kwargs)
File "/tmp/tmpg46c1ntq.py", line 6, in step_two
for i in some_list:
TypeError: 'PosixPath' object is not iterable How should empty lists be handled in pipelines? Why is my empty list converted to a
PosixPath ` ?