Skip to content

[sdk] values using placeholder partially are not replace if they are in list/dict #12040

@mai-nakagawa

Description

@mai-nakagawa

Environment

  • KFP version:

2.13.0

  • KFP SDK version:

2.13.0

  • All dependencies version:
kfp                              2.13.0
kfp-pipeline-spec                0.7.0
kfp-server-api                   2.4.0

Steps to reproduce

  1. Run the following script:
from kfp import compiler
from kfp import dsl


@dsl.component
def hello(level1_whole: str, level1_partial: str, level2: dict):
    print(level1_whole, level1_partial, level2)


@dsl.pipeline(name="hello-pipeline")
def my_pipeline(greeting: str):
    hello(
        level1_whole=greeting,
        level1_partial=f"greeting={greeting}",
        level2={
            "level2_whole": greeting,
            "level2_partial": f"greeting={greeting}",
        })


if __name__ == '__main__':
    package_path = __file__ + ".yaml"
    compiler.Compiler().compile(my_pipeline, package_path)
  1. Opening the compiled Yaml file, you will see level1_whole, level1_partial and level2_whole are correctly replaced but level2_partial is not:
        inputs:
          parameters:
            level1_partial:
              runtimeValue:
                constant: greeting={{$.inputs.parameters['pipelinechannel--greeting']}}
            level1_whole:
              componentInputParameter: greeting
            level2:
              runtimeValue:
                constant:
                  level2_partial: greeting={{channel:task=;name=greeting;type=String;}}
                  level2_whole: '{{$.inputs.parameters[''pipelinechannel--greeting'']}}'
            pipelinechannel--greeting:
              componentInputParameter: greeting

Expected result

level2_partial is also correctly replaced.

Materials and Reference

Seems the bug relates to #10883


Impacted by this bug? Give it a 👍.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions