-
Notifications
You must be signed in to change notification settings - Fork 1
Labels
ready for testingThis issue has been fixed and is ready for testingThis issue has been fixed and is ready for testing
Milestone
Description
If you did the following:
with Run(mode="offline") as run:
run.init("test_run", metadata={"first": 1}
run.update_metadata({"second": 2})
sender()
Then the first bit of metadata will not be seen in the online run. I think this is because in _cache(), there is only a shallow merging of dictionaries. So when run.init is called, the staging file will be written like this:
{
"name": "test_run",
"metadata": {
"first": 1
}
...
}
Then when you call run.update_metadata, it will write another set of metadata to simvue.sv_obj, but inside _cache() the line:
_local_data |= self._staging
Means the metadata key will be overriden by what is in staging, so the cache becomes:
{
"name": "test_run",
"metadata": {
"second": 2
}
...
}
The sender then runs on this, uploading only the second piece.
Need to:
- Improve metadata and tags tests to check for this
- Add a deeper merging of dictionaries - can either do this by hand, or https://pypi.org/project/deepmerge/ seems good
Metadata
Metadata
Assignees
Labels
ready for testingThis issue has been fixed and is ready for testingThis issue has been fixed and is ready for testing