Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix serialization of reducer metadata. #446

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading