Skip to content

Update metadata and tags wont work in Offline mode #691

@wk9874

Description

@wk9874

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:

Metadata

Metadata

Assignees

Labels

ready for testingThis issue has been fixed and is ready for testing

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions