KFP V2 upgrade issue with concatenating strings

50 views Asked by At

I am having this pipeline whereby I am passing parameters and I would like to concat strings when being passed to a component but due to pythonic upgrade being done, this fails to parse correctly.

Code Snippet:

@component(base_image=PYTHON310, 
           packages_to_install=None,)
def add_component(
    d:str,
    e:dict=None
) -> int:
    print(d)
    print(e)
    return c

@kfp.dsl.pipeline(
    name = 'kfp-test',
    pipeline_root = URI+'/'+str(TIMESTAMP)+'/kfp/'
)
def pipeline(
    g: str = "name",
):

    k=f"Hello {g}"
    output2 = add_component(
        a = a1,
        b = b1,
        d=k,
        e={"key":k}
    ).set_display_name("test")

The string got printed as expected "Hello name" but dict fails to parse correctly {'key': 'Hello {{channel:task=;name=g;type=String;}}'} This used to work fine in kfp v1

Try to parse concatenated string in dict using kfp pipeline

0

There are 0 answers