home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1059076885

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/6069#issuecomment-1059076885 https://api.github.com/repos/pydata/xarray/issues/6069 1059076885 IC_kwDOAMm_X84_IDsV 6574622 2022-03-04T11:23:56Z 2022-03-04T11:23:56Z CONTRIBUTOR

Ok, I believe, I've now reproduced your error:

```python import xarray as xr from rasterio.enums import Resampling import numpy as np ds = xr.tutorial.open_dataset('air_temperature').isel(time=0) ds = ds.rio.write_crs('EPSG:4326') dst = ds.rio.reproject('EPSG:3857', shape=(250, 250), resampling=Resampling.bilinear, nodata=np.nan) dst.air.encoding = {} dst = dst.assign(air=dst.air.expand_dims("time"), time=dst.time.expand_dims("time"))

m = {} dst.to_zarr(m) dst.to_zarr(m, append_dim="time") raises: ValueError: failed to prevent overwriting existing key _FillValue in attrs. This is probably an encoding field used by xarray to describe how a variable is serialized. To proceed, remove this key from the variable's attributes manually. ```

This seems to be due to handling of CF-Conventions which might go wrong in the append case: the CFMaskCoder verifies that there isn't any fill value present in the dataset before defining one here. I'd guess in the append case, one wouldn't want to check if the fill value is already defined, but instead want to check that it is the same. However, I don't know a lot about the CF encoding pieces of xarray...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  1077079208
Powered by Datasette · Queries took 0.712ms · About: xarray-datasette