From 77144501ac6ca0649379137401e6a2bd3daed8b8 Mon Sep 17 00:00:00 2001 From: Max Bohomolov Date: Tue, 12 Aug 2025 16:15:08 +0000 Subject: [PATCH] clear get_record --- .../resource_clients/key_value_store.py | 32 +------------------ uv.lock | 2 +- 2 files changed, 2 insertions(+), 32 deletions(-) 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 7100d475..5522c4be 100644 --- a/src/apify_client/clients/resource_clients/key_value_store.py +++ b/src/apify_client/clients/resource_clients/key_value_store.py @@ -1,6 +1,5 @@ from __future__ import annotations -import warnings from contextlib import asynccontextmanager, contextmanager from http import HTTPStatus from typing import TYPE_CHECKING, Any @@ -101,43 +100,18 @@ def list_keys( return parse_date_fields(pluck_data(response.json())) - 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', @@ -376,10 +350,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. diff --git a/uv.lock b/uv.lock index 4e297b08..26e7a5df 100644 --- a/uv.lock +++ b/uv.lock @@ -23,7 +23,7 @@ wheels = [ [[package]] name = "apify-client" -version = "1.12.2" +version = "1.12.3" source = { editable = "." } dependencies = [ { name = "apify-shared" },