def correct_extension(filename: str, extension: str ='.csv') -> str:
    """Ensures that the passed in filename has the correct extension. Defaults
    to csv.
    
    Parameters
    ----------
        filename (str) : The filename to verify whether it has the extension.
        extension (str) : The extension that the filename should have.
    
    Returns
    -------
        (str) : The filename with the proper extension attached to it.
    """
    if filename[-len(extension):] != extension:
        # If it has another extension, remove it
        if '.' in filename:
            filename = filename[:filename.find('.')]
        
        filename += extension
    
    return filename