def geo_to_str(latitude, longitude, distance):
    """
    Return geolocation data as string of comma-separated values.
    """
    has_valid_unit = distance.endswith("km") or distance.endswith("mi")
    assert has_valid_unit, "Must include units as 'km' or 'mi'."

    return ",".join((latitude, longitude, distance))