apify 3.4.2b29__tar.gz → 3.4.2b31__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.
- {apify-3.4.2b29 → apify-3.4.2b31}/CHANGELOG.md +1 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/PKG-INFO +2 -2
- {apify-3.4.2b29 → apify-3.4.2b31}/pyproject.toml +2 -2
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/_configuration.py +32 -26
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_apify/_request_queue_client.py +4 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_apify/_request_queue_shared_client.py +12 -2
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_apify/_request_queue_single_client.py +5 -2
- {apify-3.4.2b29 → apify-3.4.2b31}/.gitignore +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/CONTRIBUTING.md +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/LICENSE +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/README.md +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/__init__.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/_actor.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/_charging.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/_consts.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/_crypto.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/_proxy_configuration.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/_utils.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/_webhook.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/errors.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/events/__init__.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/events/_apify_event_manager.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/events/_types.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/events/py.typed +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/log.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/py.typed +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/request_loaders/__init__.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/request_loaders/_apify_request_list.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/request_loaders/py.typed +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/__init__.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/_actor_runner.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/_async_thread.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/_logging_config.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/_serialization.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/extensions/__init__.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/extensions/_httpcache.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/middlewares/__init__.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/middlewares/apify_proxy.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/middlewares/py.typed +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/pipelines/__init__.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/pipelines/actor_dataset_push.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/pipelines/py.typed +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/py.typed +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/requests.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/scheduler.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/scrapy/utils.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/__init__.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_apify/__init__.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_apify/_alias_resolving.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_apify/_api_client_creation.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_apify/_dataset_client.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_apify/_key_value_store_client.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_apify/_models.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_apify/_storage_client.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_apify/_utils.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_apify/py.typed +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_file_system/__init__.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_file_system/_dataset_client.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_file_system/_key_value_store_client.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_file_system/_storage_client.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_ppe_dataset_mixin.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_smart_apify/__init__.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_smart_apify/_storage_client.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/py.typed +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storages/__init__.py +0 -0
- {apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storages/py.typed +0 -0
|
@@ -32,6 +32,7 @@ All notable changes to this project will be documented in this file.
|
|
|
32
32
|
- **scrapy:** Avoid mutating request userData during Scrapy-Apify conversion ([#978](https://github.com/apify/apify-sdk-python/pull/978)) ([b0b7df7](https://github.com/apify/apify-sdk-python/commit/b0b7df72eb169778ab88be04d8b30bb0bdc307d3)) by [@vdusek](https://github.com/vdusek)
|
|
33
33
|
- **scrapy:** Async-thread startup race, shutdown lifecycle, and timeout setting ([#979](https://github.com/apify/apify-sdk-python/pull/979)) ([ae12935](https://github.com/apify/apify-sdk-python/commit/ae1293512f5ee781533dab5b1dd1f0af0fcc2497)) by [@vdusek](https://github.com/vdusek)
|
|
34
34
|
- Commit request queue dedup cache only after batch_add_requests succeeds ([#975](https://github.com/apify/apify-sdk-python/pull/975)) ([078ab87](https://github.com/apify/apify-sdk-python/commit/078ab8744c96e61a5226a9d19869b5e0df71ab23)) by [@vdusek](https://github.com/vdusek)
|
|
35
|
+
- Prevent request queue softlock by adding `is_finished` and correcting `is_empty` ([#1008](https://github.com/apify/apify-sdk-python/pull/1008)) ([4ead0c6](https://github.com/apify/apify-sdk-python/commit/4ead0c64d2a95263b2fa970f5a8fff9141db62b2)) by [@Mantisus](https://github.com/Mantisus), closes [#987](https://github.com/apify/apify-sdk-python/issues/987)
|
|
35
36
|
|
|
36
37
|
### 🚜 Refactor
|
|
37
38
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: apify
|
|
3
|
-
Version: 3.4.
|
|
3
|
+
Version: 3.4.2b31
|
|
4
4
|
Summary: Apify SDK for Python
|
|
5
5
|
Project-URL: Apify Homepage, https://apify.com
|
|
6
6
|
Project-URL: Changelog, https://docs.apify.com/sdk/python/docs/changelog
|
|
@@ -228,7 +228,7 @@ Classifier: Typing :: Typed
|
|
|
228
228
|
Requires-Python: >=3.11
|
|
229
229
|
Requires-Dist: apify-client<4.0.0,>=3.0.0
|
|
230
230
|
Requires-Dist: cachetools>=5.5.0
|
|
231
|
-
Requires-Dist: crawlee<2.0.0,>=1.0
|
|
231
|
+
Requires-Dist: crawlee<2.0.0,>=1.8.0
|
|
232
232
|
Requires-Dist: cryptography>=42.0.0
|
|
233
233
|
Requires-Dist: impit>=0.8.0
|
|
234
234
|
Requires-Dist: lazy-object-proxy>=1.11.0
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "apify"
|
|
7
|
-
version = "3.4.
|
|
7
|
+
version = "3.4.2b31"
|
|
8
8
|
description = "Apify SDK for Python"
|
|
9
9
|
authors = [{ name = "Apify Technologies s.r.o.", email = "support@apify.com" }]
|
|
10
10
|
license = { file = "LICENSE" }
|
|
@@ -36,7 +36,7 @@ keywords = [
|
|
|
36
36
|
]
|
|
37
37
|
dependencies = [
|
|
38
38
|
"apify-client>=3.0.0,<4.0.0",
|
|
39
|
-
"crawlee>=1.0
|
|
39
|
+
"crawlee>=1.8.0,<2.0.0",
|
|
40
40
|
"cachetools>=5.5.0",
|
|
41
41
|
"cryptography>=42.0.0",
|
|
42
42
|
"impit>=0.8.0",
|
|
@@ -7,7 +7,8 @@ from logging import getLogger
|
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
from typing import TYPE_CHECKING, Annotated, Any, Self
|
|
9
9
|
|
|
10
|
-
from pydantic import AliasChoices, BeforeValidator, Field, model_validator
|
|
10
|
+
from pydantic import AliasChoices, AliasGenerator, BeforeValidator, ConfigDict, Field, model_validator
|
|
11
|
+
from pydantic.alias_generators import to_camel
|
|
11
12
|
from typing_extensions import TypedDict
|
|
12
13
|
|
|
13
14
|
from crawlee import service_locator
|
|
@@ -111,6 +112,11 @@ class Configuration(CrawleeConfiguration):
|
|
|
111
112
|
or it can be specific to each `Actor` instance on the `actor.config` property.
|
|
112
113
|
"""
|
|
113
114
|
|
|
115
|
+
# Fields are validated from environment variables via their `validation_alias`, but serialized under a
|
|
116
|
+
# camelCase name derived from the Python field name. This keeps `model_dump(by_alias=True)` consistent
|
|
117
|
+
# (e.g. `is_at_home` -> `isAtHome`) instead of leaking the raw env-var names.
|
|
118
|
+
model_config = ConfigDict(alias_generator=AliasGenerator(serialization_alias=to_camel))
|
|
119
|
+
|
|
114
120
|
actor_id: Annotated[
|
|
115
121
|
str | None,
|
|
116
122
|
Field(
|
|
@@ -204,7 +210,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
204
210
|
api_base_url: Annotated[
|
|
205
211
|
str,
|
|
206
212
|
Field(
|
|
207
|
-
|
|
213
|
+
validation_alias='apify_api_base_url',
|
|
208
214
|
description='Internal URL of the Apify API. May be used to interact with the platform programmatically',
|
|
209
215
|
),
|
|
210
216
|
] = 'https://api.apify.com'
|
|
@@ -212,7 +218,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
212
218
|
api_public_base_url: Annotated[
|
|
213
219
|
str,
|
|
214
220
|
Field(
|
|
215
|
-
|
|
221
|
+
validation_alias='apify_api_public_base_url',
|
|
216
222
|
description='Public URL of the Apify API. May be used to link to REST API resources',
|
|
217
223
|
),
|
|
218
224
|
] = 'https://api.apify.com'
|
|
@@ -220,7 +226,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
220
226
|
dedicated_cpus: Annotated[
|
|
221
227
|
float | None,
|
|
222
228
|
Field(
|
|
223
|
-
|
|
229
|
+
validation_alias='apify_dedicated_cpus',
|
|
224
230
|
description='Number of CPU cores reserved for the actor, based on allocated memory',
|
|
225
231
|
),
|
|
226
232
|
] = None
|
|
@@ -261,13 +267,13 @@ class Configuration(CrawleeConfiguration):
|
|
|
261
267
|
disable_outdated_warning: Annotated[
|
|
262
268
|
bool,
|
|
263
269
|
Field(
|
|
264
|
-
|
|
270
|
+
validation_alias='apify_disable_outdated_warning',
|
|
265
271
|
description='Controls the display of outdated SDK version warnings',
|
|
266
272
|
),
|
|
267
273
|
BeforeValidator(lambda val: val or False),
|
|
268
274
|
] = False
|
|
269
275
|
|
|
270
|
-
fact: Annotated[str | None, Field(
|
|
276
|
+
fact: Annotated[str | None, Field(validation_alias='apify_fact')] = None
|
|
271
277
|
|
|
272
278
|
input_key: Annotated[
|
|
273
279
|
str,
|
|
@@ -284,7 +290,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
284
290
|
input_secrets_private_key_file: Annotated[
|
|
285
291
|
str | None,
|
|
286
292
|
Field(
|
|
287
|
-
|
|
293
|
+
validation_alias='apify_input_secrets_private_key_file',
|
|
288
294
|
description='Path to the secret key used to decrypt Secret inputs.',
|
|
289
295
|
),
|
|
290
296
|
] = None
|
|
@@ -292,7 +298,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
292
298
|
input_secrets_private_key_passphrase: Annotated[
|
|
293
299
|
str | None,
|
|
294
300
|
Field(
|
|
295
|
-
|
|
301
|
+
validation_alias='apify_input_secrets_private_key_passphrase',
|
|
296
302
|
description='Passphrase for the input secret key',
|
|
297
303
|
),
|
|
298
304
|
] = None
|
|
@@ -300,7 +306,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
300
306
|
is_at_home: Annotated[
|
|
301
307
|
bool,
|
|
302
308
|
Field(
|
|
303
|
-
|
|
309
|
+
validation_alias='apify_is_at_home',
|
|
304
310
|
description='True if the Actor is running on Apify servers',
|
|
305
311
|
),
|
|
306
312
|
] = False
|
|
@@ -308,7 +314,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
308
314
|
max_paid_dataset_items: Annotated[
|
|
309
315
|
int | None,
|
|
310
316
|
Field(
|
|
311
|
-
|
|
317
|
+
validation_alias='actor_max_paid_dataset_items',
|
|
312
318
|
description='For paid-per-result Actors, the user-set limit on returned results. Do not exceed this limit',
|
|
313
319
|
),
|
|
314
320
|
BeforeValidator(_default_if_empty(default=None)),
|
|
@@ -317,7 +323,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
317
323
|
max_total_charge_usd: Annotated[
|
|
318
324
|
Decimal | None,
|
|
319
325
|
Field(
|
|
320
|
-
|
|
326
|
+
validation_alias='actor_max_total_charge_usd',
|
|
321
327
|
description='For pay-per-event Actors, the user-set limit on total charges. Do not exceed this limit',
|
|
322
328
|
),
|
|
323
329
|
BeforeValidator(_default_if_empty(default=None)),
|
|
@@ -326,7 +332,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
326
332
|
test_pay_per_event: Annotated[
|
|
327
333
|
bool,
|
|
328
334
|
Field(
|
|
329
|
-
|
|
335
|
+
validation_alias='actor_test_pay_per_event',
|
|
330
336
|
description='Enable pay-per-event functionality for local development',
|
|
331
337
|
),
|
|
332
338
|
] = False
|
|
@@ -334,7 +340,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
334
340
|
meta_origin: Annotated[
|
|
335
341
|
str | None,
|
|
336
342
|
Field(
|
|
337
|
-
|
|
343
|
+
validation_alias='apify_meta_origin',
|
|
338
344
|
description='Specifies how an Actor run was started',
|
|
339
345
|
),
|
|
340
346
|
] = None
|
|
@@ -342,7 +348,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
342
348
|
metamorph_after_sleep: Annotated[
|
|
343
349
|
timedelta_ms,
|
|
344
350
|
Field(
|
|
345
|
-
|
|
351
|
+
validation_alias='apify_metamorph_after_sleep_millis',
|
|
346
352
|
description='How long the Actor needs to wait before exiting after triggering a metamorph',
|
|
347
353
|
),
|
|
348
354
|
] = timedelta(minutes=5)
|
|
@@ -350,7 +356,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
350
356
|
proxy_hostname: Annotated[
|
|
351
357
|
str,
|
|
352
358
|
Field(
|
|
353
|
-
|
|
359
|
+
validation_alias='apify_proxy_hostname',
|
|
354
360
|
description='Hostname of the Apify proxy',
|
|
355
361
|
),
|
|
356
362
|
] = 'proxy.apify.com'
|
|
@@ -358,7 +364,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
358
364
|
proxy_password: Annotated[
|
|
359
365
|
str | None,
|
|
360
366
|
Field(
|
|
361
|
-
|
|
367
|
+
validation_alias='apify_proxy_password',
|
|
362
368
|
description='Password to the Apify proxy',
|
|
363
369
|
),
|
|
364
370
|
] = None
|
|
@@ -366,7 +372,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
366
372
|
proxy_port: Annotated[
|
|
367
373
|
int,
|
|
368
374
|
Field(
|
|
369
|
-
|
|
375
|
+
validation_alias='apify_proxy_port',
|
|
370
376
|
description='Port to communicate with the Apify proxy',
|
|
371
377
|
),
|
|
372
378
|
] = 8000
|
|
@@ -374,7 +380,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
374
380
|
proxy_status_url: Annotated[
|
|
375
381
|
str,
|
|
376
382
|
Field(
|
|
377
|
-
|
|
383
|
+
validation_alias='apify_proxy_status_url',
|
|
378
384
|
description='URL for retrieving proxy status information',
|
|
379
385
|
),
|
|
380
386
|
] = 'http://proxy.apify.com'
|
|
@@ -406,7 +412,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
406
412
|
str,
|
|
407
413
|
BeforeValidator(validate_http_url),
|
|
408
414
|
Field(
|
|
409
|
-
|
|
415
|
+
validation_alias='actor_standby_url',
|
|
410
416
|
description='URL for accessing web servers of Actor runs in Standby mode',
|
|
411
417
|
),
|
|
412
418
|
] = 'http://localhost'
|
|
@@ -414,7 +420,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
414
420
|
token: Annotated[
|
|
415
421
|
str | None,
|
|
416
422
|
Field(
|
|
417
|
-
|
|
423
|
+
validation_alias='apify_token',
|
|
418
424
|
description='API token of the user who started the Actor',
|
|
419
425
|
),
|
|
420
426
|
] = None
|
|
@@ -422,7 +428,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
422
428
|
user_id: Annotated[
|
|
423
429
|
str | None,
|
|
424
430
|
Field(
|
|
425
|
-
|
|
431
|
+
validation_alias='apify_user_id',
|
|
426
432
|
description='ID of the user who started the Actor. May differ from the Actor owner',
|
|
427
433
|
),
|
|
428
434
|
] = None
|
|
@@ -430,7 +436,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
430
436
|
user_is_paying: Annotated[
|
|
431
437
|
bool,
|
|
432
438
|
Field(
|
|
433
|
-
|
|
439
|
+
validation_alias='apify_user_is_paying',
|
|
434
440
|
description='True if the user calling the Actor is paying user',
|
|
435
441
|
),
|
|
436
442
|
BeforeValidator(_default_if_empty(default=False)),
|
|
@@ -462,7 +468,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
462
468
|
workflow_key: Annotated[
|
|
463
469
|
str | None,
|
|
464
470
|
Field(
|
|
465
|
-
|
|
471
|
+
validation_alias='apify_workflow_key',
|
|
466
472
|
description='Identifier used for grouping related runs and API calls together',
|
|
467
473
|
),
|
|
468
474
|
] = None
|
|
@@ -474,7 +480,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
474
480
|
| PayPerEventActorPricingInfo
|
|
475
481
|
| None,
|
|
476
482
|
Field(
|
|
477
|
-
|
|
483
|
+
validation_alias='apify_actor_pricing_info',
|
|
478
484
|
description='JSON string with pricing info of the actor',
|
|
479
485
|
discriminator='pricing_model',
|
|
480
486
|
),
|
|
@@ -484,7 +490,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
484
490
|
charged_event_counts: Annotated[
|
|
485
491
|
dict[str, int] | None,
|
|
486
492
|
Field(
|
|
487
|
-
|
|
493
|
+
validation_alias='apify_charged_actor_event_counts',
|
|
488
494
|
description='Counts of events that were charged for the actor',
|
|
489
495
|
),
|
|
490
496
|
BeforeValidator(lambda data: json.loads(data) if isinstance(data, str) else data or None),
|
|
@@ -493,7 +499,7 @@ class Configuration(CrawleeConfiguration):
|
|
|
493
499
|
actor_storages: Annotated[
|
|
494
500
|
ActorStorages | None,
|
|
495
501
|
Field(
|
|
496
|
-
|
|
502
|
+
validation_alias='actor_storages_json',
|
|
497
503
|
description='Mapping of storage aliases to their platform-assigned IDs.',
|
|
498
504
|
),
|
|
499
505
|
BeforeValidator(_load_storage_keys),
|
|
@@ -198,3 +198,7 @@ class ApifyRequestQueueClient(RequestQueueClient):
|
|
|
198
198
|
@override
|
|
199
199
|
async def is_empty(self) -> bool:
|
|
200
200
|
return await self._implementation.is_empty()
|
|
201
|
+
|
|
202
|
+
@override
|
|
203
|
+
async def is_finished(self) -> bool:
|
|
204
|
+
return await self._implementation.is_finished()
|
{apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_apify/_request_queue_shared_client.py
RENAMED
|
@@ -338,8 +338,18 @@ class ApifyRequestQueueSharedClient:
|
|
|
338
338
|
# Check _list_head.
|
|
339
339
|
# Without the lock the `is_empty` is prone to falsely report True with some low probability race condition.
|
|
340
340
|
async with self._fetch_lock:
|
|
341
|
-
|
|
342
|
-
|
|
341
|
+
return await self._is_empty()
|
|
342
|
+
|
|
343
|
+
async def is_finished(self) -> bool:
|
|
344
|
+
"""Specific implementation of this method for the RQ shared access mode."""
|
|
345
|
+
async with self._fetch_lock:
|
|
346
|
+
# Order of operations is important here, because affects on `_queue_has_locked_requests`.
|
|
347
|
+
return await self._is_empty() and not self._queue_has_locked_requests
|
|
348
|
+
|
|
349
|
+
async def _is_empty(self) -> bool:
|
|
350
|
+
"""Check whether anything is available to fetch. Lock-free core of `is_empty`, caller must hold the lock."""
|
|
351
|
+
head = await self._list_head(limit=1)
|
|
352
|
+
return len(head.items) == 0
|
|
343
353
|
|
|
344
354
|
async def _get_metadata_estimate(self) -> RequestQueueMetadata:
|
|
345
355
|
"""Try to get cached metadata first. If multiple clients, fuse with global metadata.
|
{apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_apify/_request_queue_single_client.py
RENAMED
|
@@ -324,9 +324,12 @@ class ApifyRequestQueueSingleClient:
|
|
|
324
324
|
|
|
325
325
|
async def is_empty(self) -> bool:
|
|
326
326
|
"""Specific implementation of this method for the RQ single access mode."""
|
|
327
|
-
# Without the lock the `is_empty` is prone to falsely report True with some low probability race condition.
|
|
328
327
|
await self._ensure_head_is_non_empty()
|
|
329
|
-
return not self._head_requests
|
|
328
|
+
return not self._head_requests
|
|
329
|
+
|
|
330
|
+
async def is_finished(self) -> bool:
|
|
331
|
+
"""Specific implementation of this method for the RQ single access mode."""
|
|
332
|
+
return await self.is_empty() and not self._requests_in_progress
|
|
330
333
|
|
|
331
334
|
async def _ensure_head_is_non_empty(self) -> None:
|
|
332
335
|
"""Ensure that the queue head has requests if they are available in the queue."""
|
|
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
|
|
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
|
|
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-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_apify/_key_value_store_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{apify-3.4.2b29 → apify-3.4.2b31}/src/apify/storage_clients/_file_system/_key_value_store_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
|