apify 2.0.0b10__tar.gz → 2.0.0b12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of apify might be problematic. Click here for more details.
- {apify-2.0.0b10 → apify-2.0.0b12}/PKG-INFO +1 -1
- {apify-2.0.0b10 → apify-2.0.0b12}/pyproject.toml +1 -1
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/apify_storage_client/_request_queue_client.py +15 -3
- {apify-2.0.0b10 → apify-2.0.0b12}/LICENSE +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/README.md +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/__init__.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/_actor.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/_configuration.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/_consts.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/_crypto.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/_models.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/_platform_event_manager.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/_proxy_configuration.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/_utils.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/apify_storage_client/__init__.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/apify_storage_client/_apify_storage_client.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/apify_storage_client/_dataset_client.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/apify_storage_client/_dataset_collection_client.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/apify_storage_client/_key_value_store_client.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/apify_storage_client/_key_value_store_collection_client.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/apify_storage_client/_request_queue_collection_client.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/apify_storage_client/py.typed +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/log.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/py.typed +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/scrapy/__init__.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/scrapy/middlewares/__init__.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/scrapy/middlewares/apify_proxy.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/scrapy/middlewares/py.typed +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/scrapy/pipelines/__init__.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/scrapy/pipelines/actor_dataset_push.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/scrapy/pipelines/py.typed +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/scrapy/py.typed +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/scrapy/requests.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/scrapy/scheduler.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/scrapy/utils.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/storages/__init__.py +0 -0
- {apify-2.0.0b10 → apify-2.0.0b12}/src/apify/storages/py.typed +0 -0
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from typing import TYPE_CHECKING
|
|
4
4
|
|
|
5
|
+
from more_itertools import chunked
|
|
5
6
|
from typing_extensions import override
|
|
6
7
|
|
|
7
8
|
from crawlee import Request
|
|
@@ -157,8 +158,11 @@ class RequestQueueClient(BaseRequestQueueClient):
|
|
|
157
158
|
*,
|
|
158
159
|
forefront: bool = False,
|
|
159
160
|
) -> BatchRequestsOperationResponse:
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
processed = []
|
|
162
|
+
unprocessed = []
|
|
163
|
+
|
|
164
|
+
for chunk in chunked(requests, 25): # The API endpoint won't accept more than 25 requests at once
|
|
165
|
+
response = await self._client.batch_add_requests(
|
|
162
166
|
requests=[
|
|
163
167
|
r.model_dump(
|
|
164
168
|
by_alias=True,
|
|
@@ -170,10 +174,18 @@ class RequestQueueClient(BaseRequestQueueClient):
|
|
|
170
174
|
'data',
|
|
171
175
|
},
|
|
172
176
|
)
|
|
173
|
-
for r in
|
|
177
|
+
for r in chunk
|
|
174
178
|
],
|
|
175
179
|
forefront=forefront,
|
|
176
180
|
)
|
|
181
|
+
processed.extend(response['processedRequests'])
|
|
182
|
+
unprocessed.extend(response['unprocessedRequests'])
|
|
183
|
+
|
|
184
|
+
return BatchRequestsOperationResponse.model_validate(
|
|
185
|
+
{
|
|
186
|
+
'processedRequests': processed,
|
|
187
|
+
'unprocessedRequests': unprocessed,
|
|
188
|
+
}
|
|
177
189
|
)
|
|
178
190
|
|
|
179
191
|
@override
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{apify-2.0.0b10 → apify-2.0.0b12}/src/apify/apify_storage_client/_dataset_collection_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{apify-2.0.0b10 → apify-2.0.0b12}/src/apify/apify_storage_client/_request_queue_collection_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|