@@ -40,7 +40,6 @@ def __init__(
40
40
self ,
41
41
* ,
42
42
api_client : RequestQueueClientAsync ,
43
- api_public_base_url : str ,
44
43
lock : asyncio .Lock ,
45
44
) -> None :
46
45
"""Initialize a new instance.
@@ -50,9 +49,6 @@ def __init__(
50
49
self ._api_client = api_client
51
50
"""The Apify request queue client for API operations."""
52
51
53
- self ._api_public_base_url = api_public_base_url
54
- """The public base URL for accessing the key-value store records."""
55
-
56
52
self ._lock = lock
57
53
"""A lock to ensure that only one operation is performed at a time."""
58
54
@@ -166,7 +162,6 @@ async def open(
166
162
167
163
return cls (
168
164
api_client = apify_rq_client ,
169
- api_public_base_url = api_public_base_url ,
170
165
lock = asyncio .Lock (),
171
166
)
172
167
@@ -198,13 +193,14 @@ async def add_batch_of_requests(
198
193
Returns:
199
194
Response containing information about the added requests.
200
195
"""
201
- # Prepare requests for API by converting to dictionaries
202
- requests_dict = [request .model_dump (by_alias = True ) for request in requests ]
203
-
204
- # Remove 'id' fields from requests as the API doesn't accept them
205
- for request_dict in requests_dict :
206
- if 'id' in request_dict :
207
- del request_dict ['id' ]
196
+ # Prepare requests for API by converting to dictionaries.
197
+ requests_dict = [
198
+ request .model_dump (
199
+ by_alias = True ,
200
+ exclude = {'id' }, # Exclude ID fields from requests since the API doesn't accept them.
201
+ )
202
+ for request in requests
203
+ ]
208
204
209
205
# Send requests to API
210
206
response = await self ._api_client .batch_add_requests (requests = requests_dict , forefront = forefront )
0 commit comments