In the latest version, 2.7.0
the following pipeline throws an error at compile time: AttributeError: 'NoneType' object has no attribute 'name'
from kfp import dsl, compiler
@dsl.component
def loop_function():
return "foo"
@dsl.component
def standalone_function():
return "bar"
@dsl.component
def standalone_function_with_args(cfg: dict):
return "bar"
@dsl.pipeline()
def pipe_main(cfg: dict):
with dsl.ParallelFor(items=[1, 5, 10], parallelism=2) as i:
task1 = loop_function()
task2 = standalone_function_with_args(cfg=cfg)
task2.after(task1)
If the function that creates task2
doesn't take any arguments, the compilation occurs without any errors. The number of arguments or their type (tested with int, str, dict) does not seem to matter. So just replacing the last two rows with these two would compile OK (but without the desired functionality):
task2 = standalone_function()
task2.after(task1)