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: add summary task pydantic validator #350

Merged
merged 5 commits into from
Mar 24, 2023

Conversation

SdgJlbl
Copy link
Contributor

@SdgJlbl SdgJlbl commented Mar 15, 2023

Related issue

Substra/substra-backend#613

Summary

Fix calls to the API (substra-backend), adding a SummaryTask Pydantic validator to handle the new return format for lists of compute tasks.

Notes

A lot of changes are just replacements list() -> []. Can be reviewed commit by commit to avoid noise.

Please check if the PR fulfills these requirements

  • If necessary, the changelog has been updated
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • The commit message follows the conventional commit specification
  • For any breaking changes, companion PRs have been opened on the following repositories:

@SdgJlbl SdgJlbl force-pushed the fix/compute-task-performance-issue branch from 60e7a18 to 6ae1eb9 Compare March 15, 2023 16:24
@SdgJlbl SdgJlbl changed the title fix: add detailed query params in sdk requests for compute task list [DO NOT MERGE]fix: add detailed query params in sdk requests for compute task list Mar 15, 2023
@SdgJlbl SdgJlbl force-pushed the fix/compute-task-performance-issue branch 5 times, most recently from 7409af4 to c0456dc Compare March 21, 2023 10:33
…ew backend API

Signed-off-by: SdgJlbl <sarah.diot-girard@owkin.com>
@SdgJlbl SdgJlbl force-pushed the fix/compute-task-performance-issue branch from c0456dc to 94f1c4d Compare March 22, 2023 09:09
@SdgJlbl SdgJlbl changed the title [DO NOT MERGE]fix: add detailed query params in sdk requests for compute task list fix: add abridged task pydantic validator Mar 22, 2023
@SdgJlbl SdgJlbl changed the title fix: add abridged task pydantic validator fix!: add abridged task pydantic validator Mar 22, 2023
@SdgJlbl SdgJlbl marked this pull request as ready for review March 22, 2023 14:00
@SdgJlbl SdgJlbl requested a review from a team as a code owner March 22, 2023 14:00
Copy link
Contributor

@guilhem-barthes guilhem-barthes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR! I am not sure about the abridged term. As much I can appreciate its meaning, I don't know if it would be understand correctly by most people. I don't know if SummaryTask would be better, or renaming the previous task as InterfacedTask/TaskWithInterface TaskWithIO. Maybe other @Substra/code-owners can give their opinion?

Comment on lines 174 to 175
"start_date": "2021-11-12T09:28:06.947765800Z",
"end_date": "2021-11-12T09:30:04.705947400Z",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were these change needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that the unit tests were testing more than what they are actually 😅
I'll create an issue about that and revert those changes.

@SdgJlbl SdgJlbl changed the title fix!: add abridged task pydantic validator fix: add abridged task pydantic validator Mar 23, 2023
@SdgJlbl
Copy link
Contributor Author

SdgJlbl commented Mar 23, 2023

Not perfectly happy with the naming either, maybe renaming the object with the previous as TaskWithIO is the best option, and AbridgedTask would just be Task.
Welcoming any feedback here

SdgJlbl added 3 commits March 23, 2023 17:19
Signed-off-by: SdgJlbl <sarah.diot-girard@owkin.com>
Signed-off-by: SdgJlbl <sarah.diot-girard@owkin.com>
Signed-off-by: SdgJlbl <sarah.diot-girard@owkin.com>
@SdgJlbl SdgJlbl force-pushed the fix/compute-task-performance-issue branch from 6de1097 to 07230e5 Compare March 23, 2023 16:20
@SdgJlbl SdgJlbl requested a review from guilhem-barthes March 23, 2023 16:29
@SdgJlbl SdgJlbl changed the title fix: add abridged task pydantic validator fix: add summary task pydantic validator Mar 23, 2023
@@ -147,9 +147,15 @@ def list(
"""Joins the results of the [local db](substra.sdk.backends.local.db.list) and the
[remote db](substra.sdk.backends.rest_client.list) in hybrid mode.
"""
local_assets = self._db.list(type_=type_, filters=filters, order_by=order_by, ascending=ascending)
if type_ == schemas.Type.SummaryTask:
# for the local DB, we need to map the abridged task type to the regular task type
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# for the local DB, we need to map the abridged task type to the regular task type
# for the local DB, we need to map the summary task type to the regular task type

Copy link
Contributor

@guilhem-barthes guilhem-barthes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: SdgJlbl <sarah.diot-girard@owkin.com>
@SdgJlbl SdgJlbl force-pushed the fix/compute-task-performance-issue branch from 51ccbd8 to 5225d92 Compare March 24, 2023 07:41
@guilhem-barthes guilhem-barthes merged commit 401daac into main Mar 24, 2023
@guilhem-barthes guilhem-barthes deleted the fix/compute-task-performance-issue branch March 24, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants