kedro/framework/cli/pipeline.py
def delete_pipeline(name, env, yes):
    """Delete a modular pipeline by providing the pipeline name as an argument."""
    try:
        context = load_context(Path.cwd(), env=env)
    except Exception as err:  # pylint: disable=broad-except
        _handle_exception(
            f"Unable to load Kedro context with environment `{env}`. "
            f"Make sure it exists in the project configuration.\nError: {err}"
        )

    package_dir = _get_project_package_dir(context)

    env = env or "base"
    pipeline_artifacts = _get_pipeline_artifacts(context, pipeline_name=name, env=env)
    dirs = [path for path in pipeline_artifacts if path.is_dir()]

    if not yes:
        click.echo(
            "The following directories and everything within them will be removed:\n"
        )
        click.echo(indent("\n".join(str(dir_) for dir_ in dirs), " " * 2))
        click.echo()
        yes = click.confirm(f"Are you sure you want to delete pipeline `{name}`?")
        click.echo()

    if not yes:
        raise KedroCliError("Deletion aborted!")

    _delete_dirs(*dirs)
    click.secho(f"\nPipeline `{name}` was successfully deleted.\n", fg="green")
    click.secho(
        f"If you added the pipeline `{name}` to `create_pipelines()` in "
        f"`{package_dir / 'pipeline.py'}`, you will need to remove it.`",
        fg="yellow",
    )
Delete a modular pipeline by providing the pipeline name as an argument.
Delete a modular pipeline by providing the pipeline name as an argument.
Delete a modular pipeline by providing the pipeline name as an argument .
def delete_pipeline(name, env, yes):
    try:
        context = load_context(Path.cwd(), env=env)
    except Exception as err:  
        _handle_exception(
            f"Unable to load Kedro context with environment `{env}`. "
            f"Make sure it exists in the project configuration.\nError: {err}"
        )
    package_dir = _get_project_package_dir(context)
    env = env or "base"
    pipeline_artifacts = _get_pipeline_artifacts(context, pipeline_name=name, env=env)
    dirs = [path for path in pipeline_artifacts if path.is_dir()]
    if not yes:
        click.echo(
            "The following directories and everything within them will be removed:\n"
        )
        click.echo(indent("\n".join(str(dir_) for dir_ in dirs), " " * 2))
        click.echo()
        yes = click.confirm(f"Are you sure you want to delete pipeline `{name}`?")
        click.echo()
    if not yes:
        raise KedroCliError("Deletion aborted!")
    _delete_dirs(*dirs)
    click.secho(f"\nPipeline `{name}` was successfully deleted.\n", fg="green")
    click.secho(
        f"If you added the pipeline `{name}` to `create_pipelines()` in "
        f"`{package_dir / 'pipeline.py'}`, you will need to remove it.`",
        fg="yellow",
    )
def delete_pipeline ( name , env , yes ) : try : context = load_context ( Path . cwd ( ) , env = env ) except Exception as err : _handle_exception ( f"Unable to load Kedro context with environment `{env}`. " f"Make sure it exists in the project configuration.\nError: {err}" ) package_dir = _get_project_package_dir ( context ) env = env or "base" pipeline_artifacts = _get_pipeline_artifacts ( context , pipeline_name = name , env = env ) dirs = [ path for path in pipeline_artifacts if path . is_dir ( ) ] if not yes : click . echo ( "The following directories and everything within them will be removed:\n" ) click . echo ( indent ( "\n" . join ( str ( dir_ ) for dir_ in dirs ) , " " * 2 ) ) click . echo ( ) yes = click . confirm ( f"Are you sure you want to delete pipeline `{name}`?" ) click . echo ( ) if not yes : raise KedroCliError ( "Deletion aborted!" ) _delete_dirs ( * dirs ) click . secho ( f"\nPipeline `{name}` was successfully deleted.\n" , fg = "green" ) click . secho ( f"If you added the pipeline `{name}` to `create_pipelines()` in " f"`{package_dir / 'pipeline.py'}`, you will need to remove it.`" , fg = "yellow" , )
Delete a modular pipeline by providing the pipeline name as an argument.
Delete a modular pipeline by providing the pipeline name as an argument .
"""Delete a modular pipeline by providing the pipeline name as an argument.""" # pylint: disable=broad-except
name
env
yes