Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sdk] Cannot refer to the loop parameter within the grandchild task #6628

Closed
chensun opened this issue Sep 28, 2021 · 0 comments · Fixed by #6643
Closed

[sdk] Cannot refer to the loop parameter within the grandchild task #6628

chensun opened this issue Sep 28, 2021 · 0 comments · Fixed by #6643
Assignees

Comments

@chensun
Copy link
Member

chensun commented Sep 28, 2021

Environment

  • KFP version:
    Vertex Pipelines

  • KFP SDK version:
    1.8.2

Steps to reproduce

Run the following pipeline on Vertex Pipelines:

from kfp import components
from kfp import dsl
import kfp.v2.compiler as compiler
 
@components.create_component_from_func
def print_op(msg: str):
  print(msg)
 
@dsl.pipeline(
    name='pipeline-with-loops-and-conditions',
    pipeline_root=PIPELINE_ROOT,
)
def my_pipeline(text_parameter: str = '[{"p_a": -1, "p_b": ["hello", "world"]}, {"p_a": 2, "p_b": ["nihao", "shijie"]}]'):
  with dsl.ParallelFor(text_parameter) as item:
    with dsl.Condition(item.p_a != "-1"):
      with dsl.ParallelFor(item.p_b) as item_p_b:
        print_op(item_p_b)
          
 
compiler.Compiler().compile(pipeline_func=my_pipeline, 
                            package_path='loops-and-conditions.json')

Expected result

Expect no error

Actual results

Get HTTP 400 error with message:
Component input parameter 'pipelineparam--text_parameter-loop-item' is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant