Skip to content

Commit

Permalink
Fix serialization of reducer metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwartzentruber committed May 31, 2024
1 parent 01d2798 commit b4ccb29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion grizzly/common/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,9 @@ def add_to_reporter(
"""
# only add detailed stats for expected results
if expected:
reporter.add_extra_metadata("reducer-stats", self.finished_steps)
reporter.add_extra_metadata(
"reducer-stats", [astuple(step) for step in self.finished_steps]
)
# other parameters
if self.analysis:
reporter.add_extra_metadata("reducer-analysis", self.analysis)
Expand Down
4 changes: 2 additions & 2 deletions grizzly/common/test_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# pylint: disable=protected-access

from contextlib import closing
from dataclasses import fields
from dataclasses import astuple, fields
from itertools import count
from multiprocessing import Event, Process
from sqlite3 import connect
Expand Down Expand Up @@ -547,7 +547,7 @@ def test_reduce_status_07(mocker, tmp_path):
status.signature_info["dumb"] = True
status.add_to_reporter(reporter)
assert reporter.add_extra_metadata.call_args_list == [
mocker.call("reducer-stats", status.finished_steps),
mocker.call("reducer-stats", [astuple(s) for s in status.finished_steps]),
mocker.call("reducer-analysis", status.analysis),
mocker.call("reducer-params", status.run_params),
mocker.call("reducer-sig", status.signature_info),
Expand Down

0 comments on commit b4ccb29

Please sign in to comment.