Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.

Commit 92207f3

Browse files
authored
turn off search stats (#21)
* turn off search stats * fix type checking
1 parent 779ae6b commit 92207f3

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

datapi/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def get_collections(
248248
-------
249249
datapi.Collections
250250
"""
251-
params = {
251+
params: dict[str, Any] = {
252252
k: v
253253
for k, v in zip(
254254
["limit", "sortby", "q", "kw"], [limit, sortby, query, keywords]

datapi/catalogue.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@ def _request_kwargs(self) -> RequestKwargs:
185185
log_callback=self.log_callback,
186186
)
187187

188-
def get_collections(self, **params: Any) -> Collections:
188+
def get_collections(self, search_stats: bool = False, **params: Any) -> Collections:
189189
url = f"{self.url}/datasets"
190+
params["search_stats"] = search_stats
190191
return Collections.from_request(
191192
"get", url, params=params, **self._request_kwargs
192193
)

tests/integration_test_10_catalogue.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def test_catalogue_collections(api_anon_client: ApiClient) -> None:
1414

1515
collection_ids = list(collections.collection_ids)
1616
while len(collection_ids) != collections.json["numberMatched"]:
17+
assert "search" not in collections.json
1718
assert (next_collections := collections.next) is not None
1819
collections = next_collections
1920
collection_ids.extend(collections.collection_ids)

0 commit comments

Comments
 (0)