def assert_no_overlapping_dates(old_data, to_add):
    """assert old_data and to_data have no overlapping dates"""
    unq_dates = lambda x: set(x.date if hasattr(x, 'date') else x.index)
    overlap = unq_dates(to_add).intersection(unq_dates(old_data))
    if overlap:
        raise ValueError(u'Data for dates {} has already been ingested'.
            format(overlap))
