def get_s3_filename(s3_path):
    """Fetches the filename of a key from S3
    Args:
        s3_path (str): 'production/output/file.txt'
    Returns (str): 'file.txt'
    """
    if s3_path.split('/')[-1] == '':
        raise ValueError('Supplied S3 path: {} is a directory not a file path'.format(s3_path))
    return s3_path.split('/')[-1]