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

fix(sdk.v2): Fix the issue that using dsl. prefix in component I/O type annotation breaks component at runtime. #6714

Merged
merged 4 commits into from
Oct 11, 2021

Conversation

chensun
Copy link
Member

@chensun chensun commented Oct 11, 2021

Description of your changes:
Before this change, if a v2 function-based component has dsl. in its component I/O type annotation, for example:

from kfp.v2 import dsl

@component
def my_component(html_artifact: dsl.Output[dsl.HTML]):
    html_content = '<!DOCTYPE html><html><body><h1>Hello world</h1></body></html>'
    with open(html_artifact.path, 'w') as f:
        f.write(html_content)

It breaks at runtime with error: NameError: name 'dsl' is not defined.

The fix is to include import kfp and from kfp.v2 import dsl in the container cmd line.

Checklist:

@ji-yaqi
Copy link
Contributor

ji-yaqi commented Oct 11, 2021

/lgtm
/approve
Thanks @chensun !

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ji-yaqi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot google-oss-robot merged commit 073c819 into kubeflow:master Oct 11, 2021
@chensun chensun deleted the runtime-imports branch October 11, 2021 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants