def _get_extension_for_entry(intake_entry):
    """
    Given an intake catalog entry, return a file extension for it, which can
    be used to construct names when re-uploading the files to s3. It would be
    nice to be able to rely on extensions in the URL, but that is not
    particularly reliable. Instead, we infer an extension from the driver and
    args that are used. The following extensions are returned:

        GeoJSON: ".geojson"
        Zipped Shapefile: ".zip"
        Shapefile: ".shp"
        CSV: ".csv"
    """
    driver = intake_entry.get('driver')
    if (driver == 'geojson' or driver ==
        'intake_geopandas.geopandas.GeoJSONSource'):
        return '.geojson'
    elif driver == 'shapefile' or driver == 'intake_geopandas.geopandas.ShapefileSource':
        return '.zip'
    elif driver == 'csv' or driver == 'intake.source.csv.CSVSource':
        return '.csv'
    else:
        raise ValueError(f'Unsupported driver {driver}')
