Skip to content

Commit

Permalink
Fix DatasetClient.show_dataset() for a deleted dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Mar 7, 2024
1 parent 12929a8 commit 639c4df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion bioblend/_tests/TestGalaxyDatasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ def test_show_nonexistent_dataset(self):
self.gi.datasets.show_dataset("nonexistent_id")

def test_show_dataset(self):
self.gi.datasets.show_dataset(self.dataset_id)
dataset = self.gi.datasets.show_dataset(self.dataset_id)
assert dataset["id"] == self.dataset_id
assert not dataset["deleted"]
self.gi.histories.delete_dataset(self.history_id, self.dataset_id)
dataset = self.gi.datasets.show_dataset(self.dataset_id)
assert dataset["id"] == self.dataset_id
assert dataset["deleted"]

def test_download_dataset(self):
with pytest.raises((TypeError, ConnectionError)):
Expand Down
4 changes: 2 additions & 2 deletions bioblend/galaxy/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DatasetClient(Client):
def __init__(self, galaxy_instance: "GalaxyInstance") -> None:
super().__init__(galaxy_instance)

def show_dataset(self, dataset_id: str, deleted: bool = False, hda_ldda: HdaLdda = "hda") -> Dict[str, Any]:
def show_dataset(self, dataset_id: str, hda_ldda: HdaLdda = "hda") -> Dict[str, Any]:
"""
Get details about a given dataset. This can be a history or a library dataset.
Expand All @@ -62,7 +62,7 @@ def show_dataset(self, dataset_id: str, deleted: bool = False, hda_ldda: HdaLdda
params = dict(
hda_ldda=hda_ldda,
)
return self._get(id=dataset_id, deleted=deleted, params=params)
return self._get(id=dataset_id, params=params)

def _initiate_download(
self, dataset_id: str, stream_content: bool, require_ok_state: bool = True, maxwait: float = 12000
Expand Down

0 comments on commit 639c4df

Please sign in to comment.