Skip to content

Commit 9cea17c

Browse files
committed
🐛 Fixed wrong function in grids reconnect
1 parent 2053b81 commit 9cea17c

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

simvue/api/objects/grids.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ def attach_metric_for_run(self, run_id: str, metric_name: str) -> None:
5252
"""Associates a metric for a given run to this grid."""
5353
if self._offline:
5454
self._staging.setdefault("runs", [])
55-
self._staging["runs"].append(run_id)
55+
self._staging["runs"].append((run_id, metric_name))
5656
super().commit()
5757
return
58+
5859
_response = sv_put(
5960
url=f"{self.run_data_url(run_id)}",
6061
headers=self._headers,
@@ -78,9 +79,11 @@ def on_reconnect(self, id_mapping: dict[str, str]) -> None:
7879
id_mapping : dict[str, str]
7980
mapping from offline identifier to new online identifier.
8081
"""
81-
for run_id in self._staging.pop("runs", []):
82+
for run_id, metric_name in self._staging.pop("runs", []):
8283
try:
83-
self.attach_to_run(run_id=id_mapping[run_id])
84+
self.attach_metric_for_run(
85+
run_id=id_mapping[run_id], metric_name=metric_name
86+
)
8487
except KeyError:
8588
raise RuntimeError("Failed to retrieve online run identifier.")
8689

simvue/sender.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"folders",
2727
"tags",
2828
"alerts",
29-
"grids",
3029
"runs",
30+
"grids",
3131
"artifacts",
3232
"metrics",
3333
"grid_metrics",

0 commit comments

Comments
 (0)