import click


def validate_loaded_geodataframes(geodataframes, layer_names):
    """
    Validate ``geodataframes`` as they are loaded.

    Some columns (namely FID) cause issues when saving to geopackage.
    Currently these columns are removed to remove the issue.
    """
    for geodataframe, layer_name in zip(geodataframes, layer_names):
        fid = "fid"
        if fid in geodataframe.columns:
            geodataframe.drop(columns=fid, inplace=True)
            click.echo(
                click.style(
                    f"Columns of layer: {layer_name} had to be modified.\n"
                    f"Field with name: {fid} was removed.",
                    fg="red",
                )
            )
    return geodataframes