Skip to content

Commit 8e70e59

Browse files
committed
Merge remote-tracking branch 'origin/master' into redirect-status-messages
2 parents 8fbbffa + fb45668 commit 8e70e59

File tree

3 files changed

+37
-7
lines changed

3 files changed

+37
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file.
88
### 🚀 Features
99

1010
- Add `validate_input` endpoint ([#396](https://github.com/apify/apify-client-python/pull/396)) ([1c5bf85](https://github.com/apify/apify-client-python/commit/1c5bf8550ffd91b94ea83694f7c933cf2767fadc)) by [@Pijukatel](https://github.com/Pijukatel), closes [#151](https://github.com/apify/apify-client-python/issues/151)
11+
- Add list kv store keys by collection or prefix ([#397](https://github.com/apify/apify-client-python/pull/397)) ([6747c20](https://github.com/apify/apify-client-python/commit/6747c201cd654953a97a4c3fe8256756eb7568c7)) by [@MFori](https://github.com/MFori)
12+
- Add redirected actor logs ([#403](https://github.com/apify/apify-client-python/pull/403)) ([fd02cd8](https://github.com/apify/apify-client-python/commit/fd02cd8726f1664677a47dcb946a0186080d7839)) by [@Pijukatel](https://github.com/Pijukatel), closes [#402](https://github.com/apify/apify-client-python/issues/402)
1113

1214

1315
<!-- git-cliff-unreleased-end -->

src/apify_client/clients/resource_clients/key_value_store.py

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,33 @@ def delete(self) -> None:
6363
"""
6464
return self._delete(timeout_secs=_SMALL_TIMEOUT)
6565

66-
def list_keys(self, *, limit: int | None = None, exclusive_start_key: str | None = None) -> dict:
66+
def list_keys(
67+
self,
68+
*,
69+
limit: int | None = None,
70+
exclusive_start_key: str | None = None,
71+
collection: str | None = None,
72+
prefix: str | None = None,
73+
) -> dict:
6774
"""List the keys in the key-value store.
6875
6976
https://docs.apify.com/api/v2#/reference/key-value-stores/key-collection/get-list-of-keys
7077
7178
Args:
7279
limit: Number of keys to be returned. Maximum value is 1000.
7380
exclusive_start_key: All keys up to this one (including) are skipped from the result.
81+
collection: The name of the collection in store schema to list keys from.
82+
prefix: The prefix of the keys to be listed.
7483
7584
Returns:
7685
The list of keys in the key-value store matching the given arguments.
7786
"""
78-
request_params = self._params(limit=limit, exclusiveStartKey=exclusive_start_key)
87+
request_params = self._params(
88+
limit=limit,
89+
exclusiveStartKey=exclusive_start_key,
90+
collection=collection,
91+
prefix=prefix,
92+
)
7993

8094
response = self.http_client.call(
8195
url=self._url('keys'),
@@ -292,19 +306,33 @@ async def delete(self) -> None:
292306
"""
293307
return await self._delete(timeout_secs=_SMALL_TIMEOUT)
294308

295-
async def list_keys(self, *, limit: int | None = None, exclusive_start_key: str | None = None) -> dict:
309+
async def list_keys(
310+
self,
311+
*,
312+
limit: int | None = None,
313+
exclusive_start_key: str | None = None,
314+
collection: str | None = None,
315+
prefix: str | None = None,
316+
) -> dict:
296317
"""List the keys in the key-value store.
297318
298319
https://docs.apify.com/api/v2#/reference/key-value-stores/key-collection/get-list-of-keys
299320
300321
Args:
301322
limit: Number of keys to be returned. Maximum value is 1000.
302323
exclusive_start_key: All keys up to this one (including) are skipped from the result.
324+
collection: The name of the collection in store schema to list keys from.
325+
prefix: The prefix of the keys to be listed.
303326
304327
Returns:
305328
The list of keys in the key-value store matching the given arguments.
306329
"""
307-
request_params = self._params(limit=limit, exclusiveStartKey=exclusive_start_key)
330+
request_params = self._params(
331+
limit=limit,
332+
exclusiveStartKey=exclusive_start_key,
333+
collection=collection,
334+
prefix=prefix,
335+
)
308336

309337
response = await self.http_client.call(
310338
url=self._url('keys'),

website/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)