asdf-format / asdf

ASDF (Advanced Scientific Data Format) is a next generation interchange format for scientific data
http://asdf.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
511 stars 56 forks source link

Old (<2.14) versions of asdf do not fully support ASDF standard 1.6.0 #1776

Open braingram opened 3 months ago

braingram commented 3 months ago

ASDF standard 1.6.0 is nearing a stable point: https://github.com/asdf-format/asdf/pull/1744 It is likely that no more schema changes will be made to the 1.6.0 standard. After downstream packages update, 1.6.0 can be enabled as the new default and no longer be marked as "development": https://github.com/asdf-format/asdf/blob/aedf1563eeeb64eec61c860073e20e88ddb49d5c/asdf/versioning.py#L161

However, 1.6.0 contains a new ndarray schema version (and tag version): https://github.com/asdf-format/asdf-standard/blob/main/resources/schemas/stsci.edu/asdf/core/ndarray-1.1.0.yaml

This creates an issue for asdf versions older than 2.14 as they have hard-coded support for only a single version (1.0.0): https://github.com/asdf-format/asdf/blob/8d535c61444733d57e2680eceea85612ca76c2ea/asdf/tags/core/ndarray.py#L213-L216

If a file was written using asdf < 2.14 and standard 1.6.0 was enabled. The file will have been produced with a ndarray-1.0.0 tag which is no longer readable (a AsdfConversionWarning and tagged representation will instead be returned).

This issue highlights some dangers to allowing asdf to produce files with "developement" standard versions with no warnings to the user that the file they are producing may at some point in the future be unreadable.

This issue documents the incompatibility. https://github.com/asdf-format/asdf/pull/1771 addresses the currently failing compatibility tests (which only revealed the issue after the asdf-standard release as they only use the released version of asdf-standard).

For any asdf users who might find this issue please reach out if you have difficulty reading files that were previously written with 1.6.0.

In the future the following may help to avoid re-occurance of this issue: