from typing import Optional


def column_name_to_metric_target(col_name: str) -> tuple[str, Optional[str]]:
    """
    Return (metric_name, column_name) from column name that build by this class.
    """
    parts = col_name.split("__")
    if parts[0] == "table_metric":
        return parts[1], None
    if parts[0] == "column_metric":
        return parts[1], parts[2]
    raise ValueError(f"col_name: {col_name} may not be built by this class")