Skip to content

Commit

Permalink
chore: rename compute task status (#188)
Browse files Browse the repository at this point in the history
Signed-off-by: SdgJlbl <[email protected]>
  • Loading branch information
SdgJlbl authored Feb 19, 2024
1 parent efa8765 commit e77e190
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions substrafl/model_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import substra
import substratools
from substra.sdk.models import Status
from substra.sdk.models import ComputeTaskStatus

import substrafl
from substrafl import exceptions
Expand Down Expand Up @@ -356,7 +356,7 @@ def _download_task_output_files(
rank_idx=rank_idx,
tag=task_type,
)
if task.status is not Status.done:
if task.status is not ComputeTaskStatus.done:
raise exceptions.UnfinishedTaskError(
f"Can't download algo files form task {task.key} as it is " f"in status {task.status}"
)
Expand Down
8 changes: 5 additions & 3 deletions tests/test_model_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def fake_local_train_task(trunk_model):
permissions=substra.models.Permissions(process={"public": True, "authorized_ids": []}), value=trunk_model
),
}
local_train_task.status = substra.models.Status.done
local_train_task.status = substra.models.ComputeTaskStatus.done

return local_train_task

Expand All @@ -116,7 +116,7 @@ def fake_aggregate_task(trunk_model):
permissions=substra.models.Permissions(process={"public": True, "authorized_ids": []}), value=model
),
}
aggregate_task.status = substra.models.Status.done
aggregate_task.status = substra.models.ComputeTaskStatus.done

return aggregate_task

Expand Down Expand Up @@ -447,7 +447,9 @@ def test_load_model_dependency(algo_files_with_local_dependency, is_dependency_u
assert res == "hello world"


@pytest.mark.parametrize("status", [e.value for e in substra.models.Status if e.value != substra.models.Status.done])
@pytest.mark.parametrize(
"status", [e.value for e in substra.models.ComputeTaskStatus if e.value != substra.models.ComputeTaskStatus.done]
)
def test_unfinished_task_error(
fake_client,
fake_compute_plan,
Expand Down

0 comments on commit e77e190

Please sign in to comment.