home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 811875421

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
811875421 MDU6SXNzdWU4MTE4NzU0MjE= 4926 Serializing a Dataset to_zarr prints error message for NetCDF 8948865 open 0     0 2021-02-19T09:53:52Z 2021-02-19T10:57:52Z   NONE      

What happened:

```python

TypeError Traceback (most recent call last) <ipython-input-30-62e3bddfeac0> in <module> 2 ds = xr.Dataset() 3 ds[0] = xr.DataArray() ----> 4 ds.to_zarr()

/opt/conda/envs/eurodatacube-0.22.3/lib/python3.8/site-packages/xarray/core/dataset.py in to_zarr(self, store, chunk_store, mode, synchronizer, group, encoding, compute, consolidated, append_dim, region) 1743 encoding = {} 1744 -> 1745 return to_zarr( 1746 self, 1747 store=store,

/opt/conda/envs/eurodatacube-0.22.3/lib/python3.8/site-packages/xarray/backends/api.py in to_zarr(dataset, store, chunk_store, mode, synchronizer, group, encoding, compute, consolidated, append_dim, region) 1452 1453 # validate Dataset keys, DataArray names, and attr keys/values -> 1454 _validate_dataset_names(dataset) 1455 _validate_attrs(dataset) 1456

/opt/conda/envs/eurodatacube-0.22.3/lib/python3.8/site-packages/xarray/backends/api.py in _validate_dataset_names(dataset) 205 206 for k in dataset.variables: --> 207 check_name(k) 208 209

/opt/conda/envs/eurodatacube-0.22.3/lib/python3.8/site-packages/xarray/backends/api.py in check_name(name) 198 ) 199 elif name is not None: --> 200 raise TypeError( 201 f"Invalid name {name!r} for DataArray or Dataset key: " 202 "must be either a string or None for serialization to netCDF "

TypeError: Invalid name 0 for DataArray or Dataset key: must be either a string or None for serialization to netCDF files ```

What you expected to happen:

Print error message referring to zarr: python TypeError: Invalid name 0 for DataArray or Dataset key: must be either a string or None for serialization to zarr files

Minimal Complete Verifiable Example:

python import xarray as xr ds = xr.Dataset() ds[0] = xr.DataArray() ds.to_zarr()

Environment:

Output of <tt>xr.show_versions()</tt> ``` INSTALLED VERSIONS ------------------ commit: None python: 3.8.6 | packaged by conda-forge | (default, Oct 7 2020, 19:08:05) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 4.14.177-139.253.amzn2.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: en_US.UTF-8 LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.16.2 pandas: 1.1.5 numpy: 1.19.4 scipy: 1.5.3 netCDF4: 1.5.5 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: 2.6.1 cftime: 1.3.0 nc_time_axis: None PseudoNetCDF: None rasterio: 1.1.5 cfgrib: None iris: None bottleneck: 1.3.2 dask: 2.30.0 distributed: 2.30.1 matplotlib: 3.3.3 cartopy: 0.17.0 seaborn: 0.11.0 numbagg: None pint: None setuptools: 49.6.0.post20201009 pip: 20.3.2 conda: None pytest: None IPython: 7.19.0 sphinx: 3.3.1 ```
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4926/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 0 rows from issue in issue_comments
Powered by Datasette · Queries took 0.572ms · About: xarray-datasette