Bug: _add_metadata_to_xarray does not add completed_timestamp_raw and run_timestamp_raw if those are None which is inconsistent and confusing
There is an inconsistency between the export and load methods. _add_metadata_to_xarray simply does not add two attributes completed_timestamp_raw and run_timestamp_raw if they were None in the original dataset, but it does add empty placeholders for completed_timestamp and run_timestamp even if they are None.
This is the function: https://github.com/microsoft/Qcodes/blob/40da9d9331b9c3cd5bb61757dc5c640f43333c61/src/qcodes/dataset/exporters/export_to_xarray.py#L156
So the solution should be to always add the *_raw timestamps as attrbiutes upon export. If they are None, set them on xarray dataset as None as well. And when loading from a netcdf file, perform a correct handling on None value for those. And for datasets that were exported to netcdf before this change, apply the following logic: if those attributes are not present, then try to calculate them from the non-raw versions of these timestamp attributes.
@astafan8 This was fixed in #7333 right?
Correct! #7333 fixed this!