GithubHelp home page GithubHelp logo

ark-kun / pipeline_components Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 4.0 988 KB

Components that I have created for Kubeflow Pipelines. Try them in https://cloud-pipelines.net/pipeline-editor/

License: Apache License 2.0

Python 95.53% Jupyter Notebook 3.62% Dockerfile 0.04% Shell 0.42% JavaScript 0.19% Rust 0.19%
kubeflow-pipelines machine-learning kfp pipelines cloud-pipelines ml-pipelines mlops

pipeline_components's People

Contributors

ark-kun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pipeline_components's Issues

Unsupported argo version when creating a pipeline that Transform DataFrame in CSV Format

I am attempting to run a kubeflow pipeline in the code through this repo https://github.com/Ark-kun/pipeline_components/blob/master/components/pandas/Select_columns/in_CSV_format/component.py and trying to transform a csv on my kubeflow notebook server but seeing this issue:
Empty DataFrame Columns: [/home/jovyan/iris-1.csv] Index: []

from kfp.components import InputPath, OutputPath, create_component_from_func


def select_columns_using_Pandas_on_CSV_data(
    table_path: InputPath("CSV"),
    transformed_table_path: OutputPath("CSV"),
    column_names: list,
):
    """Selects columns from a data table.
    Args:
        table_path: Input data table.
        transformed_table_path: Transformed data table that only has the chosen columns.
        column_names: Names of the columns to select from the table.
    """
    import pandas

    df = pandas.read_csv(
        table_path,
        dtype="string",
    )
    print(df.head(5))
    print(InputPath)
    df = df[column_names]

    df.to_csv(transformed_table_path, index=False)



select_columns_using_Pandas_on_CSV_data_op = create_component_from_func(
        select_columns_using_Pandas_on_CSV_data,
        output_component_file="component.yaml",
        base_image="python:3.9",
        packages_to_install=["pandas==1.4.2",],
        annotations={
            "author": "Alexey Volkov <[email protected]>",
            "canonical_location": "https://raw.githubusercontent.com/Ark-kun/pipeline_components/master/components/pandas/Select_columns/in_CSV_format/component.yaml",
        },
    )
@kfp.dsl.pipeline(name='my-pipeline')
def my_pipeline(
    table_path: str,
    transform_code: str
):
    transform_dataframe_task = select_columns_using_Pandas_on_CSV_data_op('/home/jovyan/iris-1.csv',['setosa'])
    
# Compile and run the pipeline
kfp.compiler.Compiler().compile(my_pipeline, 'my-pipeline.tar.gz')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.