Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datapi/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def get_collections(
-------
datapi.Collections
"""
params = {
params: dict[str, Any] = {
k: v
for k, v in zip(
["limit", "sortby", "q", "kw"], [limit, sortby, query, keywords]
Expand Down
3 changes: 2 additions & 1 deletion datapi/catalogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,9 @@ def _request_kwargs(self) -> RequestKwargs:
log_callback=self.log_callback,
)

def get_collections(self, **params: Any) -> Collections:
def get_collections(self, search_stats: bool = False, **params: Any) -> Collections:
url = f"{self.url}/datasets"
params["search_stats"] = search_stats
return Collections.from_request(
"get", url, params=params, **self._request_kwargs
)
Expand Down
1 change: 1 addition & 0 deletions tests/integration_test_10_catalogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def test_catalogue_collections(api_anon_client: ApiClient) -> None:

collection_ids = list(collections.collection_ids)
while len(collection_ids) != collections.json["numberMatched"]:
assert "search" not in collections.json
assert (next_collections := collections.next) is not None
collections = next_collections
collection_ids.extend(collections.collection_ids)
Expand Down