diff --git a/src/apify_client/clients/resource_clients/key_value_store.py b/src/apify_client/clients/resource_clients/key_value_store.py index ccc254f8..3f254ab9 100644 --- a/src/apify_client/clients/resource_clients/key_value_store.py +++ b/src/apify_client/clients/resource_clients/key_value_store.py @@ -1,7 +1,6 @@ from __future__ import annotations import json as jsonlib -import warnings from contextlib import asynccontextmanager, contextmanager from http import HTTPStatus from typing import TYPE_CHECKING, Any @@ -102,43 +101,18 @@ def list_keys( return parse_date_fields(pluck_data(jsonlib.loads(response.text))) - def get_record(self, key: str, *, as_bytes: bool = False, as_file: bool = False) -> dict | None: + def get_record(self, key: str) -> dict | None: """Retrieve the given record from the key-value store. https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record Args: key: Key of the record to retrieve. - as_bytes: Deprecated, use `get_record_as_bytes()` instead. Whether to retrieve the record as raw bytes, - default False. - as_file: Deprecated, use `stream_record()` instead. Whether to retrieve the record as a file-like object, - default False. Returns: The requested record, or None, if the record does not exist. """ try: - if as_bytes and as_file: - raise ValueError('You cannot have both as_bytes and as_file set.') - - if as_bytes: - warnings.warn( - '`KeyValueStoreClient.get_record(..., as_bytes=True)` is deprecated, ' - 'use `KeyValueStoreClient.get_record_as_bytes()` instead.', - DeprecationWarning, - stacklevel=2, - ) - return self.get_record_as_bytes(key) - - if as_file: - warnings.warn( - '`KeyValueStoreClient.get_record(..., as_file=True)` is deprecated, ' - 'use `KeyValueStoreClient.stream_record()` instead.', - DeprecationWarning, - stacklevel=2, - ) - return self.stream_record(key) # type: ignore[return-value] - response = self.http_client.call( url=self._url(f'records/{key}'), method='GET', @@ -377,10 +351,6 @@ async def get_record(self, key: str) -> dict | None: Args: key: Key of the record to retrieve. - as_bytes: Deprecated, use `get_record_as_bytes()` instead. Whether to retrieve the record as raw bytes, - default False. - as_file: Deprecated, use `stream_record()` instead. Whether to retrieve the record as a file-like object, - default False. Returns: The requested record, or None, if the record does not exist.