Skip to content

Commit

Permalink
Add offset parameter to InvocationClient.get_invocations() an…
Browse files Browse the repository at this point in the history
…d BioBlend.objects ``ObjInvocationClient.list()`` methods
  • Loading branch information
nsoranzo committed Feb 4, 2025
1 parent e502f79 commit b58b0a3
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 15 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### BioBlend v

* Added support for Galaxy release 24.2.

* Added ``offset`` parameter to ``InvocationClient.get_invocations()`` and
BioBlend.objects ``ObjInvocationClient.list()`` methods.

* Improvements to type annotations and documentation.

### BioBlend v1.4.0 - 2024-11-06

* Added support for Python 3.13. Added support for Galaxy release 24.1.
Expand Down
5 changes: 2 additions & 3 deletions bioblend/galaxy/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,8 @@ def get_datasets(
:param limit: Maximum number of datasets to return.
:type offset: int
:param offset: Return datasets starting from this specified position.
For example, if ``limit`` is set to 100 and ``offset`` to 200,
datasets 200-299 will be returned.
:param offset: Number of datasets to skip. Return datasets starting from
item offset+1.
:type name: str
:param name: Dataset name to filter on.
Expand Down
6 changes: 3 additions & 3 deletions bioblend/galaxy/histories/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ def get_histories(
:param keys: List of fields to return
:type limit: int
:param limit: How many items to return (upper bound).
:param limit: Maximum number of histories to return.
:type offset: int
:param offset: skip the first (offset) items and begin returning
items at index offset (i.e. start with the element offset+1).
:param offset: Number of histories to skip. Return histories starting
from item offset+1.
:rtype: list
:return: List of history dicts.
Expand Down
14 changes: 11 additions & 3 deletions bioblend/galaxy/invocations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def get_invocations(
user_id: Optional[str] = None,
include_terminal: bool = True,
limit: Optional[int] = None,
*,
offset: Optional[int] = None,
view: str = "collection",
step_details: bool = False,
) -> List[Dict[str, Any]]:
Expand All @@ -61,11 +63,15 @@ def get_invocations(
your own user ID if your are not an admin user.
:type include_terminal: bool
:param include_terminal: Whether to include terminal states.
:param include_terminal: Whether to include invocations in terminal
state.
:type limit: int
:param limit: Maximum number of invocations to return - if specified,
the most recent invocations will be returned.
:param limit: Maximum number of invocations to return.
:type offset: int
:param offset: Number of invocations to skip. Return invocations
starting from item offset+1.
:type view: str
:param view: Level of detail to return per invocation, either
Expand Down Expand Up @@ -96,6 +102,8 @@ def get_invocations(
params["user_id"] = user_id
if limit is not None:
params["limit"] = limit
if offset is not None:
params["offset"] = offset
return self._get(params=params)

def show_invocation(self, invocation_id: str) -> Dict[str, Any]:
Expand Down
5 changes: 2 additions & 3 deletions bioblend/galaxy/jobs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ def get_jobs(
:param limit: Maximum number of jobs to return.
:type offset: int
:param offset: Return jobs starting from this specified position.
For example, if ``limit`` is set to 100 and ``offset`` to 200,
jobs 200-299 will be returned.
:param offset: Number of jobs to skip. Return jobs starting from item
offset+1.
:type user_details: bool
:param user_details: If ``True`` and the user is an admin, add the user
Expand Down
11 changes: 8 additions & 3 deletions bioblend/galaxy/objects/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ def list(
history: Optional[wrappers.History] = None,
include_terminal: bool = True,
limit: Optional[int] = None,
offset: Optional[int] = None,
) -> List[wrappers.Invocation]:
"""
Get full listing of workflow invocations, or select a subset
Expand All @@ -375,11 +376,14 @@ def list(
this history
:param include_terminal: bool
:param: Whether to include invocations in terminal states
:param: Whether to include invocations in terminal state.
:type limit: int
:param limit: Maximum number of invocations to return - if specified,
the most recent invocations will be returned.
:param limit: Maximum number of invocations to return.
:type offset: int
:param offset: Number of invocations to skip. Return invocations
starting from item offset+1.
:rtype: list of Invocation
:param: invocation objects
Expand All @@ -389,6 +393,7 @@ def list(
history_id=history.id if history else None,
include_terminal=include_terminal,
limit=limit,
offset=offset,
view="element",
step_details=True,
)
Expand Down

0 comments on commit b58b0a3

Please sign in to comment.