Skip to content

Commit 7714450

Browse files
committed
clear get_record
1 parent 61f84e1 commit 7714450

File tree

2 files changed

+2
-32
lines changed

2 files changed

+2
-32
lines changed

src/apify_client/clients/resource_clients/key_value_store.py

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
import warnings
43
from contextlib import asynccontextmanager, contextmanager
54
from http import HTTPStatus
65
from typing import TYPE_CHECKING, Any
@@ -101,43 +100,18 @@ def list_keys(
101100

102101
return parse_date_fields(pluck_data(response.json()))
103102

104-
def get_record(self, key: str, *, as_bytes: bool = False, as_file: bool = False) -> dict | None:
103+
def get_record(self, key: str) -> dict | None:
105104
"""Retrieve the given record from the key-value store.
106105
107106
https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record
108107
109108
Args:
110109
key: Key of the record to retrieve.
111-
as_bytes: Deprecated, use `get_record_as_bytes()` instead. Whether to retrieve the record as raw bytes,
112-
default False.
113-
as_file: Deprecated, use `stream_record()` instead. Whether to retrieve the record as a file-like object,
114-
default False.
115110
116111
Returns:
117112
The requested record, or None, if the record does not exist.
118113
"""
119114
try:
120-
if as_bytes and as_file:
121-
raise ValueError('You cannot have both as_bytes and as_file set.')
122-
123-
if as_bytes:
124-
warnings.warn(
125-
'`KeyValueStoreClient.get_record(..., as_bytes=True)` is deprecated, '
126-
'use `KeyValueStoreClient.get_record_as_bytes()` instead.',
127-
DeprecationWarning,
128-
stacklevel=2,
129-
)
130-
return self.get_record_as_bytes(key)
131-
132-
if as_file:
133-
warnings.warn(
134-
'`KeyValueStoreClient.get_record(..., as_file=True)` is deprecated, '
135-
'use `KeyValueStoreClient.stream_record()` instead.',
136-
DeprecationWarning,
137-
stacklevel=2,
138-
)
139-
return self.stream_record(key) # type: ignore[return-value]
140-
141115
response = self.http_client.call(
142116
url=self._url(f'records/{key}'),
143117
method='GET',
@@ -376,10 +350,6 @@ async def get_record(self, key: str) -> dict | None:
376350
377351
Args:
378352
key: Key of the record to retrieve.
379-
as_bytes: Deprecated, use `get_record_as_bytes()` instead. Whether to retrieve the record as raw bytes,
380-
default False.
381-
as_file: Deprecated, use `stream_record()` instead. Whether to retrieve the record as a file-like object,
382-
default False.
383353
384354
Returns:
385355
The requested record, or None, if the record does not exist.

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)