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

Build pipeline kfp.components has no attribute InputPath #3541

Closed
mclacore opened this issue Jul 10, 2023 · 3 comments
Closed

Build pipeline kfp.components has no attribute InputPath #3541

mclacore opened this issue Jul 10, 2023 · 3 comments

Comments

@mclacore
Copy link

Getting this error when running the notebook to build a pipeline:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[6], line 1
----> 1 def merge_csv(file_path: comp.InputPath('Tarball'),
      2               output_csv: comp.OutputPath('CSV')):
      3   import glob
      4   import pandas as pd

AttributeError: module 'kfp.components' has no attribute 'InputPath'

Using this function:

def merge_csv(file_path: comp.InputPath('Tarball'),
                output_csv: comp.OutputPath('CSV')):
    import glob
    import pandas as pd
    import tarfile

    tarfile.open(name=file_path, mode="r|gz").extractall('data')
    df = pd.concat(
        [pd.read_csv(csv_file, header=None) 
        for csv_file in glob.glob('data/*.csv')])
    df.to_csv(output_csv, index=False, header=False)

Source: https://github.com/kubeflow/website/blob/master/content/en/docs/components/pipelines/v1/sdk/build-pipeline.ipynb

@wangsy503
Copy link

Maybe you can check your kfp version. You can use !pip install kfp==1.8 and try again.
I believe this error is because they removed this attribute in kfp v2.

@thesuperzapper
Copy link
Member

@mclacore @wangsy503 is correct, you cant use the kfp SDK version 2.0.1, with any currently released version of the Kubeflow backend.

You should use pip install kfp==1.8.22, if you are using Kubeflow 1.7 or earlier.

@kubeflow/wg-pipeline-leads can we please try and reduce this confusion somehow? Many people are installing kfp==2.0.1 and its breaking everything for them.

@chensun
Copy link
Member

chensun commented Jul 27, 2023

I believe this error is because they removed this attribute in kfp v2.

InputPath wasn't removed but moved to under dsl (example).

you cant use the kfp SDK version 2.0.1, with any currently released version of the Kubeflow backend.

This is correct. For clarification, depending on your needs, there's the Kubeflow Pipelines 2.0, as a standalone product, which is compatible with KFP SDK 2.0.

https://github.com/orgs/kubeflow/teams/wg-pipeline-leads can we please try and reduce this confusion somehow? Many people are installing kfp==2.0.1 and its breaking everything for them.

I think it's reasonable to expect breaking changes with major upgrade releases, especially when the backend and SDK are not on the same major version. We have documented both version compatibility and the migration guide.

Besides, the SDK client warns on using against older backend versions. I'm open to suggestions on further improvements to reduce the possible confusion.

That being said, a bigger confusion point in my observation is the version of Kubeflow and the version of Kubeflow Pipelines. For that reason, I was hoping that the next Kubeflow release could also bump to 2.0.

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

No branches or pull requests

4 participants