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

_output_files is not defined with func_to_container_op #1907

Closed
knkski opened this issue Aug 21, 2019 · 1 comment
Closed

_output_files is not defined with func_to_container_op #1907

knkski opened this issue Aug 21, 2019 · 1 comment

Comments

@knkski
Copy link

knkski commented Aug 21, 2019

What happened:

I compiled a pipeline with func_to_container_op, and didn't specify any outputs, since there aren't any. It then failed with NameError: name '_output_files' is not defined

What did you expect to happen:

I expected the pipeline step to work without having to specify an output.

What steps did you take:

Here's the function that I'm converting to a container op:

def ensure_bucket_task(endpoint: str, bucket: str):
    from minio import Minio
    from minio.error import BucketAlreadyOwnedByYou, BucketAlreadyExists

    mclient = Minio(
        endpoint,
        access_key=...,
        secret_key=...,
    )

    try:
        mclient.make_bucket(bucket)
    except (BucketAlreadyExists, BucketAlreadyOwnedByYou):
        pass

There isn't anything useful to return, since the bucket name is parameterized in the workflow parameters.

Anything else you would like to add:

This is the relevant bit from the auto-generated wrapper that is failing:

for idx, filename in enumerate(_output_files):
    _output_path = Path(filename)
    _output_path.parent.mkdir(parents=True, exist_ok=True)
    _output_path.write_text(str(_outputs[idx]))

I can fix this issue by specifying a return value. Even something like -> str and not returning anything works, but it would be nice to avoid unnecessary boilerplate.

@Ark-kun
Copy link
Contributor

Ark-kun commented Aug 22, 2019

I'm sorry you got bitten by this bug.
It was fixed in #1726
Please run pip3 install kfp --upgrade to update your SDK.

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

No branches or pull requests

2 participants