Skip to content

Commit

Permalink
fix: return value of link_dataset_with_data_samples in remote mode (#302
Browse files Browse the repository at this point in the history
)

Signed-off-by: Aurélien Gasser <aurelien.gasser@gmail.com>
Signed-off-by: Fabien Gelus <fabien.gelus@owkin.com>
  • Loading branch information
Fabien-GELUS committed Oct 6, 2022
1 parent fe41258 commit 33a4635
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion substra/sdk/backends/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import abc
from typing import List

from substra.sdk.schemas import BackendType

Expand Down Expand Up @@ -34,7 +35,7 @@ def add_compute_plan_tuples(self, spec, spec_options):
raise NotImplementedError

@abc.abstractmethod
def link_dataset_with_data_samples(self, dataset_key, data_sample_keys):
def link_dataset_with_data_samples(self, dataset_key, data_sample_keys) -> List[str]:
raise NotImplementedError

@abc.abstractmethod
Expand Down
2 changes: 1 addition & 1 deletion substra/sdk/backends/local/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ def add(self, spec, spec_options=None, key=None):
add_asset(key, spec, spec_options)
return key

def link_dataset_with_data_samples(self, dataset_key, data_sample_keys):
def link_dataset_with_data_samples(self, dataset_key, data_sample_keys) -> List[str]:
dataset = self._db.get(schemas.Type.Dataset, dataset_key)
data_samples = list()
for key in data_sample_keys:
Expand Down
3 changes: 2 additions & 1 deletion substra/sdk/backends/remote/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def add_compute_plan_tuples(self, spec, spec_options):
key=spec.key,
)

def link_dataset_with_data_samples(self, dataset_key, data_sample_keys):
def link_dataset_with_data_samples(self, dataset_key, data_sample_keys) -> List[str]:
"""Returns the list of the data sample keys"""
data = {
"data_manager_keys": [dataset_key],
Expand All @@ -278,6 +278,7 @@ def link_dataset_with_data_samples(self, dataset_key, data_sample_keys):
path="bulk_update/",
data=data,
)
return data_sample_keys

def _download(self, url: str, destination_file: str) -> str:
response = self._client.get_data(url, stream=True)
Expand Down

0 comments on commit 33a4635

Please sign in to comment.