import logging


def fetch_relationships(bucket, dataset, relation_types):
    """
    Get a listing of relationship files on S3

    Parameters
    ----------
    bucket : str

    dataset : str

    relationship_file : fileobj

    relation_types : List[str]

    Returns
    -------
    {str: [(str, str)}
        A dict of (bucket, key) pairs, where the key is the relation type
        and the value is the location of the corresponding relationship files.
    """
    relationship_locations = dict()

    for rel_type in relation_types:
        rel_file_key = "relationships/{}.csv".format(rel_type)
        logging.info("Fetching relationship {}".format(rel_file_key))
        relationship_locations[rel_type] = (bucket, rel_file_key)

    return relationship_locations