diff --git a/mdio/variable.h b/mdio/variable.h index 61e6c8e..364bb19 100644 --- a/mdio/variable.h +++ b/mdio/variable.h @@ -971,6 +971,13 @@ class Variable { if (isCloudStore) { outpath = ".zattrs"; } + + if (output_json["attributes"].contains("metadata")) { + auto metadata = output_json["attributes"]["metadata"]; + output_json["attributes"].erase("metadata"); + output_json["attributes"].merge_patch(metadata); + } + return tensorstore::kvstore::Write( store.kvstore(), outpath, absl::Cord(output_json["attributes"].dump()));