diff --git a/artiq/examples/no_hardware/repository/hdf5_attributes.py b/artiq/examples/no_hardware/repository/hdf5_attributes.py index 8237435569..f216a64b32 100644 --- a/artiq/examples/no_hardware/repository/hdf5_attributes.py +++ b/artiq/examples/no_hardware/repository/hdf5_attributes.py @@ -19,3 +19,6 @@ def run(self): self.set_dataset("dummy", dummy, broadcast=True, archive=True) self.set_dataset_metadata("dummy", {"k1": "v1", "k2": "v2"}) + + # Attach metadata to an absent key is no-op + self.set_dataset_metadata("nothing", {"no": "op"}) diff --git a/artiq/master/worker_db.py b/artiq/master/worker_db.py index f52162af22..3cf1732559 100644 --- a/artiq/master/worker_db.py +++ b/artiq/master/worker_db.py @@ -166,6 +166,8 @@ def get(self, key, archive=False): def set_metadata(self, key, metadata): if key: + if key not in self.local: + logger.warning(f"Key '{key}' not found in dataset.") self.hdf5_attributes["datasets/" + key] = metadata else: self.hdf5_attributes["datasets"] = metadata