from typing import Tuple


def parse_target_pipeline(target: str) -> Tuple:
    """Parse a pipeline name generated from format_target_pipeline and return both name and version."""
    if not target:
        raise ValueError(f"pipeline target name is not valid: {target}")
    ss = target.split("_")
    if len(ss) < 2:
        raise ValueError(f"pipeline target name is not valid: {target}")
    name = "_".join(ss[: len(ss) - 1])  # support for name containing underscore already
    version = ss[-1]
    return (name, version)