diff --git a/datapi/api_client.py b/datapi/api_client.py index 11a54c7..f521b22 100644 --- a/datapi/api_client.py +++ b/datapi/api_client.py @@ -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] diff --git a/datapi/catalogue.py b/datapi/catalogue.py index faf546a..c6184e8 100644 --- a/datapi/catalogue.py +++ b/datapi/catalogue.py @@ -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 ) diff --git a/tests/integration_test_10_catalogue.py b/tests/integration_test_10_catalogue.py index e2e9eaf..0496b64 100644 --- a/tests/integration_test_10_catalogue.py +++ b/tests/integration_test_10_catalogue.py @@ -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)