Skip to content

Commit 9f7b290

Browse files
committed
clear get_record
1 parent 753465b commit 9f7b290

File tree

1 file changed

+1
-31
lines changed

1 file changed

+1
-31
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
@@ -106,43 +105,18 @@ def list_keys(
106105

107106
return parse_date_fields(pluck_data(response.json()))
108107

109-
def get_record(self, key: str, *, as_bytes: bool = False, as_file: bool = False) -> dict | None:
108+
def get_record(self, key: str) -> dict | None:
110109
"""Retrieve the given record from the key-value store.
111110
112111
https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record
113112
114113
Args:
115114
key: Key of the record to retrieve.
116-
as_bytes: Deprecated, use `get_record_as_bytes()` instead. Whether to retrieve the record as raw bytes,
117-
default False.
118-
as_file: Deprecated, use `stream_record()` instead. Whether to retrieve the record as a file-like object,
119-
default False.
120115
121116
Returns:
122117
The requested record, or None, if the record does not exist.
123118
"""
124119
try:
125-
if as_bytes and as_file:
126-
raise ValueError('You cannot have both as_bytes and as_file set.')
127-
128-
if as_bytes:
129-
warnings.warn(
130-
'`KeyValueStoreClient.get_record(..., as_bytes=True)` is deprecated, '
131-
'use `KeyValueStoreClient.get_record_as_bytes()` instead.',
132-
DeprecationWarning,
133-
stacklevel=2,
134-
)
135-
return self.get_record_as_bytes(key)
136-
137-
if as_file:
138-
warnings.warn(
139-
'`KeyValueStoreClient.get_record(..., as_file=True)` is deprecated, '
140-
'use `KeyValueStoreClient.stream_record()` instead.',
141-
DeprecationWarning,
142-
stacklevel=2,
143-
)
144-
return self.stream_record(key) # type: ignore[return-value]
145-
146120
response = self.http_client.call(
147121
url=self._url(f'records/{key}'),
148122
method='GET',
@@ -379,10 +353,6 @@ async def get_record(self, key: str) -> dict | None:
379353
380354
Args:
381355
key: Key of the record to retrieve.
382-
as_bytes: Deprecated, use `get_record_as_bytes()` instead. Whether to retrieve the record as raw bytes,
383-
default False.
384-
as_file: Deprecated, use `stream_record()` instead. Whether to retrieve the record as a file-like object,
385-
default False.
386356
387357
Returns:
388358
The requested record, or None, if the record does not exist.

0 commit comments

Comments
 (0)