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: convert round_idx metadata to int in Performances #387

Merged
merged 3 commits into from
Sep 12, 2023
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

### Fixed

- Convert `round_idx` from metadata to `int` when creating `Performances` to fix Pydantic warning ([#387](https://github.com/Substra/substra/pull/387))

## [0.48.0](https://github.com/Substra/substra/releases/tag/0.48.0) - 2023-09-08

### Changed

- Update to pydantic 2.3.0 ([#375](https://github.com/Substra/substra/pull/375))

## [0.47.0](https://github.com/Substra/substra/releases/tag/0.47.0) - 2023-09-07
Expand Down
6 changes: 5 additions & 1 deletion substra/sdk/backends/local/dal.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ def get_performances(self, key: str) -> models.Performances:
performances.worker.append(task.worker)
performances.task_key.append(task.key)
performances.task_rank.append(task.rank)
performances.round_idx.append(task.metadata.get("round_idx"))
try:
round_idx = int(task.metadata.get("round_idx"))
except TypeError:
round_idx = None
performances.round_idx.append(round_idx)
performances.identifier.append(output.identifier)
performances.performance.append(output.asset)

Expand Down
6 changes: 5 additions & 1 deletion substra/sdk/backends/remote/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ def get_performances(self, key: str) -> models.Performances:
performances.worker.append(test_task["compute_task"]["worker"])
performances.task_key.append(test_task["compute_task"]["key"])
performances.task_rank.append(test_task["compute_task"]["rank"])
performances.round_idx.append(test_task["compute_task"]["round_idx"])
try:
round_idx = int(test_task["compute_task"]["round_idx"])
except TypeError:
round_idx = None
performances.round_idx.append(round_idx)
performances.identifier.append(test_task["identifier"])
performances.performance.append(test_task["perf"])

Expand Down
Loading