def _rename_coord_attrs(ds):
    """
    to_netcdf and to_zarr don't like coordinates attribute

    Parameters
    ----------
    ds: xarray.Dataset

    Returns
    -------
    ds: xarray.Dataset
    """
    for var in ds.variables:
        attrs = ds[var].attrs
        coordinates = attrs.pop('coordinates', None)
        ds[var].attrs = attrs
        if coordinates is not None:
            ds[var].attrs['_coordinates'] = coordinates
    return ds
