Skip to content

Warning about xarray not properly decoding step variable in future version #110

@gschulze

Description

@gschulze

When using xr.open_datatree to open several of the provided zarr files, the following warning is displayed:

/tmp/ipykernel_667/3690813853.py:3: FutureWarning: In a future version, xarray will not decode the variable 'step' into a timedelta64 dtype based on the presence of a timedelta-like 'units' attribute by default. Instead it will rely on the presence of a timedelta64 'dtype' attribute, which is now xarray's default way of encoding timedelta64 values. To continue decoding into a timedelta64 dtype, either setdecode_timedelta=Truewhen opening this dataset, or add the attributedtype='timedelta64[ns]'to this variable on disk. To opt-in to future behavior, setdecode_timedelta=False.

I think explicitly setting decode_timedelta to either True or False is a good idea to maintain future compatibility.

As far as I can tell, the following notebooks are affected:

  • 24_zarr_struct_S2L2A.ipynb
  • 44_eopf_stac_xarray_tutorial.ipynb
  • 63_sardinia_dNBR

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions