home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 1157163377

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
1157163377 I_kwDOAMm_X85E-Olx 6318 'numpy.datetime64' object has no attribute 'year' when writing to zarr or netcdf 1872600 open 0     3 2022-03-02T12:59:22Z 2022-03-16T04:23:25Z   NONE      

What happened?

I have a reproducible notebook where I've loaded a referenceFileSystem dataset into xarray and everything seems fine with time being understood correctly, but when I try to save a subset to zarr or netcdf, I get: numpy.datetime64' object has no attribute 'year' I don't understand this since it seems time is always a datetime64 object in xarray, and I've never had this problem before.

What did you expect to happen?

Expected the file to be written as usual without error.

Minimal Complete Verifiable Example

Python https://nbviewer.org/gist/rsignell-usgs/029b39f0c428b07914f5a6b1129da572

Relevant log output

No response

Anything else we need to know?

I asked the question first over at https://github.com/fsspec/kerchunk/issues/130 and @martindurant thought this looked like an xarray issue, not a kerchunk issue.

Environment

INSTALLED VERSIONS

commit: None python: 3.9.10 | packaged by conda-forge | (main, Feb 1 2022, 21:24:11) [GCC 9.4.0] python-bits: 64 OS: Linux OS-release: 4.12.14-150.17_5.0.85-cray_ari_c machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: None LOCALE: ('en_US', 'UTF-8') libhdf5: 1.12.1 libnetcdf: 4.8.1

xarray: 0.21.0 pandas: 1.4.0 numpy: 1.21.5 scipy: 1.7.3 netCDF4: 1.5.8 pydap: None h5netcdf: 0.13.1 h5py: 3.6.0 Nio: None zarr: 2.10.3 cftime: 1.5.2 nc_time_axis: None PseudoNetCDF: None rasterio: 1.2.10 cfgrib: 0.9.10.0 iris: None bottleneck: 1.3.2 dask: 2021.12.0 distributed: 2021.12.0 matplotlib: 3.5.1 cartopy: 0.20.2 seaborn: None numbagg: None fsspec: 2022.01.0 cupy: None pint: 0.18 sparse: 0.13.0 setuptools: 59.8.0 pip: 22.0.2 conda: 4.11.0 pytest: None IPython: 8.0.1 sphinx: 4.4.0

​

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6318/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
  • 3 rows from issue in issue_comments
Powered by Datasette · Queries took 0.771ms · About: xarray-datasette