Skip to content

Commit 73278c4

Browse files
authored
Fetch all projects and processes (#73)
* fetch all projects and processes * bump version
1 parent db411c8 commit 73278c4

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

cirro/api/services/process.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from cirro.api.models.form_specification import ParameterSpecification
66
from cirro.api.models.process import Executor, RunAnalysisCommand, Process
77
from cirro.api.models.s3_path import S3Path
8+
from cirro.api.services.base import fetch_all_items
89
from cirro.api.services.file import FileEnabledService
910

1011

@@ -56,8 +57,10 @@ def list(self, process_type: Executor = None) -> List[Process]:
5657
item_filter = {}
5758
if process_type:
5859
item_filter['executor'] = {'eq': process_type.value}
59-
resp = self._api_client.query(query, variables={'filter': item_filter})['listProcesses']
60-
return [Process.from_record(p) for p in resp['items']]
60+
61+
items = fetch_all_items(self._api_client, query,
62+
input_variables={'filter': item_filter})
63+
return [Process.from_record(p) for p in items]
6164

6265
def get_process(self, process_id: str) -> Process:
6366
"""

cirro/api/services/project.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from cirro.api.models.file import FileAccessContext
55
from cirro.api.models.project import Project
66
from cirro.api.models.reference import Reference, References
7+
from cirro.api.services.base import fetch_all_items
78
from cirro.api.services.file import FileEnabledService
89
from cirro.file_utils import filter_files_by_pattern
910

@@ -30,9 +31,9 @@ def list(self) -> List[Project]:
3031
}
3132
'''
3233

33-
resp = self._api_client.query(query)['listProjects']
34-
items = filter_deleted(resp['items'])
35-
return [Project.from_record(item) for item in items]
34+
items = fetch_all_items(self._api_client, query, {})
35+
not_deleted = filter_deleted(items)
36+
return [Project.from_record(item) for item in not_deleted]
3637

3738
def find_by_name(self, name: str) -> Optional[Project]:
3839
"""

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "cirro"
3-
version = "0.7.0"
3+
version = "0.7.1"
44
description = "CLI tool and SDK for interacting with the Cirro platform"
55
authors = ["Fred Hutch <[email protected]>"]
66
license = "MIT"

0 commit comments

Comments
 (0)