def METHOD_NAME(df: pd.DataFrame, mappings: dict[str, dict[str, str]]):
    """
    Clean partition columns.
    The values in `partition_cols` may have characters that are illegal in
    filenames. Strip them out and return a dataframe we can write into a parquet
    file.
    """
    for col, val_map in mappings.items():
        df[col] = df[col].map(val_map)
    return df