def get_ending(fit_format: int) -> str:
    """Get the file extension for a given fit format.

    Args:
        fit_format (int): .csv (0) or .pkl (1).

    Raises:
        Exception: If an invalid fit format is provided.

    Returns:
        str: The extension for the provided fit format.
    """
    if fit_format in [0]:
        ending = '.csv'
    elif fit_format == 1:
        ending = '.pkl'
    else:
        raise Exception("No such fit format: %s" % fit_format)
    return ending