Skip to content

Commit c086dd0

Browse files
committed
Merge remote-tracking branch 'origin/master' into feat/union-dict-model-types
# Conflicts: # src/apify_client/_resource_clients/actor.py # src/apify_client/_resource_clients/task.py
2 parents 5c00f0e + 34c37c0 commit c086dd0

25 files changed

+229
-184
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ All notable changes to this project will be documented in this file.
88
### 🚀 Features
99

1010
- [**breaking**] Make HTTP client pluggable with abstract base classes ([#641](https://github.com/apify/apify-client-python/pull/641)) ([5ae33a0](https://github.com/apify/apify-client-python/commit/5ae33a0a801fdacd0c456a8630fea053f9df6550)) by [@vdusek](https://github.com/vdusek), closes [#416](https://github.com/apify/apify-client-python/issues/416)
11+
- [**breaking**] Introduce tiered timeout system with per-endpoint configuration ([#653](https://github.com/apify/apify-client-python/pull/653)) ([723ec6e](https://github.com/apify/apify-client-python/commit/723ec6e5954474767a5ecbf4902d9b62f7d214f8)) by [@vdusek](https://github.com/vdusek)
1112

1213
### 🚜 Refactor
1314

1415
- [**breaking**] Introduce fully typed clients ([#604](https://github.com/apify/apify-client-python/pull/604)) ([81ee194](https://github.com/apify/apify-client-python/commit/81ee1943b400b49797868fe4dfa52d1662e09370)) by [@vdusek](https://github.com/vdusek), closes [#21](https://github.com/apify/apify-client-python/issues/21), [#481](https://github.com/apify/apify-client-python/issues/481)
1516
- [**breaking**] Drop support for Python 3.10 ([#636](https://github.com/apify/apify-client-python/pull/636)) ([7895a4e](https://github.com/apify/apify-client-python/commit/7895a4e60145f490911044da4aa7e3c1c424d416)) by [@vdusek](https://github.com/vdusek)
17+
- [**breaking**] Update default timeout tiers on non-storage resource clients ([#664](https://github.com/apify/apify-client-python/pull/664)) ([0b35bbe](https://github.com/apify/apify-client-python/commit/0b35bbe212a8a64c5aea5d5d813315252760b055)) by [@vdusek](https://github.com/vdusek)
1618

1719

1820
<!-- git-cliff-unreleased-end -->

src/apify_client/_resource_clients/actor.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def __init__(
8282
**kwargs,
8383
)
8484

85-
def get(self, *, timeout: Timeout = 'long') -> Actor | None:
85+
def get(self, *, timeout: Timeout = 'short') -> Actor | None:
8686
"""Retrieve the Actor.
8787
8888
https://docs.apify.com/api/v2#/reference/actors/actor-object/get-actor
@@ -126,7 +126,7 @@ def update(
126126
pricing_infos: list[dict[str, Any]] | None = None,
127127
actor_permission_level: ActorPermissionLevel | None = None,
128128
tagged_builds: dict[str, None | dict[str, str]] | None = None,
129-
timeout: Timeout = 'long',
129+
timeout: Timeout = 'short',
130130
) -> Actor:
131131
"""Update the Actor with the specified fields.
132132
@@ -206,7 +206,7 @@ def update(
206206
result = self._update(timeout=timeout, **actor_fields.model_dump(by_alias=True, exclude_none=True))
207207
return ActorResponse.model_validate(result).data
208208

209-
def delete(self, *, timeout: Timeout = 'long') -> None:
209+
def delete(self, *, timeout: Timeout = 'short') -> None:
210210
"""Delete the Actor.
211211
212212
https://docs.apify.com/api/v2#/reference/actors/actor-object/delete-actor
@@ -230,7 +230,7 @@ def start(
230230
force_permission_level: ActorPermissionLevel | None = None,
231231
wait_for_finish: int | None = None,
232232
webhooks: list[dict | WebhookCreate] | None = None,
233-
timeout: Timeout = 'long',
233+
timeout: Timeout = 'medium',
234234
) -> Run:
235235
"""Start the Actor and immediately return the Run object.
236236
@@ -307,7 +307,7 @@ def call(
307307
force_permission_level: ActorPermissionLevel | None = None,
308308
wait_duration: timedelta | None = None,
309309
logger: Logger | None | Literal['default'] = 'default',
310-
timeout: Timeout = 'long',
310+
timeout: Timeout = 'no_timeout',
311311
) -> Run | None:
312312
"""Start the Actor and wait for it to finish before returning the Run object.
313313
@@ -383,7 +383,7 @@ def build(
383383
tag: str | None = None,
384384
use_cache: bool | None = None,
385385
wait_for_finish: int | None = None,
386-
timeout: Timeout = 'long',
386+
timeout: Timeout = 'medium',
387387
) -> Build:
388388
"""Build the Actor.
389389
@@ -441,7 +441,7 @@ def default_build(
441441
self,
442442
*,
443443
wait_for_finish: int | None = None,
444-
timeout: Timeout = 'long',
444+
timeout: Timeout = 'short',
445445
) -> BuildClient:
446446
"""Retrieve Actor's default build.
447447
@@ -530,7 +530,7 @@ def validate_input(
530530
*,
531531
build_tag: str | None = None,
532532
content_type: str | None = None,
533-
timeout: Timeout = 'long',
533+
timeout: Timeout = 'short',
534534
) -> bool:
535535
"""Validate an input for the Actor that defines an input schema.
536536
@@ -578,7 +578,7 @@ def __init__(
578578
**kwargs,
579579
)
580580

581-
async def get(self, *, timeout: Timeout = 'long') -> Actor | None:
581+
async def get(self, *, timeout: Timeout = 'short') -> Actor | None:
582582
"""Retrieve the Actor.
583583
584584
https://docs.apify.com/api/v2#/reference/actors/actor-object/get-actor
@@ -622,7 +622,7 @@ async def update(
622622
pricing_infos: list[dict[str, Any]] | None = None,
623623
actor_permission_level: ActorPermissionLevel | None = None,
624624
tagged_builds: dict[str, None | dict[str, str]] | None = None,
625-
timeout: Timeout = 'long',
625+
timeout: Timeout = 'short',
626626
) -> Actor:
627627
"""Update the Actor with the specified fields.
628628
@@ -702,7 +702,7 @@ async def update(
702702
result = await self._update(timeout=timeout, **actor_fields.model_dump(by_alias=True, exclude_none=True))
703703
return ActorResponse.model_validate(result).data
704704

705-
async def delete(self, *, timeout: Timeout = 'long') -> None:
705+
async def delete(self, *, timeout: Timeout = 'short') -> None:
706706
"""Delete the Actor.
707707
708708
https://docs.apify.com/api/v2#/reference/actors/actor-object/delete-actor
@@ -726,7 +726,7 @@ async def start(
726726
force_permission_level: ActorPermissionLevel | None = None,
727727
wait_for_finish: int | None = None,
728728
webhooks: list[dict | WebhookCreate] | None = None,
729-
timeout: Timeout = 'long',
729+
timeout: Timeout = 'medium',
730730
) -> Run:
731731
"""Start the Actor and immediately return the Run object.
732732
@@ -803,7 +803,7 @@ async def call(
803803
force_permission_level: ActorPermissionLevel | None = None,
804804
wait_duration: timedelta | None = None,
805805
logger: Logger | None | Literal['default'] = 'default',
806-
timeout: Timeout = 'long',
806+
timeout: Timeout = 'no_timeout',
807807
) -> Run | None:
808808
"""Start the Actor and wait for it to finish before returning the Run object.
809809
@@ -883,7 +883,7 @@ async def build(
883883
tag: str | None = None,
884884
use_cache: bool | None = None,
885885
wait_for_finish: int | None = None,
886-
timeout: Timeout = 'long',
886+
timeout: Timeout = 'medium',
887887
) -> Build:
888888
"""Build the Actor.
889889
@@ -941,7 +941,7 @@ async def default_build(
941941
self,
942942
*,
943943
wait_for_finish: int | None = None,
944-
timeout: Timeout = 'long',
944+
timeout: Timeout = 'short',
945945
) -> BuildClientAsync:
946946
"""Retrieve Actor's default build.
947947
@@ -1030,7 +1030,7 @@ async def validate_input(
10301030
*,
10311031
build_tag: str | None = None,
10321032
content_type: str | None = None,
1033-
timeout: Timeout = 'long',
1033+
timeout: Timeout = 'short',
10341034
) -> bool:
10351035
"""Validate an input for the Actor that defines an input schema.
10361036

src/apify_client/_resource_clients/actor_collection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def list(
4949
offset: int | None = None,
5050
desc: bool | None = None,
5151
sort_by: Literal['createdAt', 'stats.lastRunStartedAt'] | None = 'createdAt',
52-
timeout: Timeout = 'long',
52+
timeout: Timeout = 'medium',
5353
) -> ListOfActors:
5454
"""List the Actors the user has created or used.
5555
@@ -94,7 +94,7 @@ def create(
9494
actor_standby_idle_timeout: timedelta | None = None,
9595
actor_standby_build: str | None = None,
9696
actor_standby_memory_mbytes: int | None = None,
97-
timeout: Timeout = 'long',
97+
timeout: Timeout = 'medium',
9898
) -> Actor:
9999
"""Create a new Actor.
100100
@@ -194,7 +194,7 @@ async def list(
194194
offset: int | None = None,
195195
desc: bool | None = None,
196196
sort_by: Literal['createdAt', 'stats.lastRunStartedAt'] | None = 'createdAt',
197-
timeout: Timeout = 'long',
197+
timeout: Timeout = 'medium',
198198
) -> ListOfActors:
199199
"""List the Actors the user has created or used.
200200
@@ -239,7 +239,7 @@ async def create(
239239
actor_standby_idle_timeout: timedelta | None = None,
240240
actor_standby_build: str | None = None,
241241
actor_standby_memory_mbytes: int | None = None,
242-
timeout: Timeout = 'long',
242+
timeout: Timeout = 'medium',
243243
) -> Actor:
244244
"""Create a new Actor.
245245

src/apify_client/_resource_clients/actor_env_var.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(
3131
**kwargs,
3232
)
3333

34-
def get(self, *, timeout: Timeout = 'long') -> EnvVar | None:
34+
def get(self, *, timeout: Timeout = 'short') -> EnvVar | None:
3535
"""Return information about the Actor environment variable.
3636
3737
https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/get-environment-variable
@@ -53,7 +53,7 @@ def update(
5353
is_secret: bool | None = None,
5454
name: str,
5555
value: str,
56-
timeout: Timeout = 'long',
56+
timeout: Timeout = 'short',
5757
) -> EnvVar:
5858
"""Update the Actor environment variable with specified fields.
5959
@@ -74,7 +74,7 @@ def update(
7474
)
7575
return EnvVarResponse.model_validate(result).data
7676

77-
def delete(self, *, timeout: Timeout = 'long') -> None:
77+
def delete(self, *, timeout: Timeout = 'short') -> None:
7878
"""Delete the Actor environment variable.
7979
8080
https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/delete-environment-variable
@@ -106,7 +106,7 @@ def __init__(
106106
**kwargs,
107107
)
108108

109-
async def get(self, *, timeout: Timeout = 'long') -> EnvVar | None:
109+
async def get(self, *, timeout: Timeout = 'short') -> EnvVar | None:
110110
"""Return information about the Actor environment variable.
111111
112112
https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/get-environment-variable
@@ -128,7 +128,7 @@ async def update(
128128
is_secret: bool | None = None,
129129
name: str,
130130
value: str,
131-
timeout: Timeout = 'long',
131+
timeout: Timeout = 'short',
132132
) -> EnvVar:
133133
"""Update the Actor environment variable with specified fields.
134134
@@ -149,7 +149,7 @@ async def update(
149149
)
150150
return EnvVarResponse.model_validate(result).data
151151

152-
async def delete(self, *, timeout: Timeout = 'long') -> None:
152+
async def delete(self, *, timeout: Timeout = 'short') -> None:
153153
"""Delete the Actor environment variable.
154154
155155
https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/delete-environment-variable

src/apify_client/_resource_clients/actor_env_var_collection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(
2929
**kwargs,
3030
)
3131

32-
def list(self, *, timeout: Timeout = 'long') -> ListOfEnvVars:
32+
def list(self, *, timeout: Timeout = 'short') -> ListOfEnvVars:
3333
"""List the available Actor environment variables.
3434
3535
https://docs.apify.com/api/v2#/reference/actors/environment-variable-collection/get-list-of-environment-variables
@@ -49,7 +49,7 @@ def create(
4949
is_secret: bool | None = None,
5050
name: str,
5151
value: str,
52-
timeout: Timeout = 'long',
52+
timeout: Timeout = 'short',
5353
) -> EnvVar:
5454
"""Create a new Actor environment variable.
5555
@@ -90,7 +90,7 @@ def __init__(
9090
**kwargs,
9191
)
9292

93-
async def list(self, *, timeout: Timeout = 'long') -> ListOfEnvVars:
93+
async def list(self, *, timeout: Timeout = 'short') -> ListOfEnvVars:
9494
"""List the available Actor environment variables.
9595
9696
https://docs.apify.com/api/v2#/reference/actors/environment-variable-collection/get-list-of-environment-variables
@@ -110,7 +110,7 @@ async def create(
110110
is_secret: bool | None = None,
111111
name: str,
112112
value: str,
113-
timeout: Timeout = 'long',
113+
timeout: Timeout = 'short',
114114
) -> EnvVar:
115115
"""Create a new Actor environment variable.
116116

src/apify_client/_resource_clients/actor_version.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __init__(
4949
**kwargs,
5050
)
5151

52-
def get(self, *, timeout: Timeout = 'long') -> Version | None:
52+
def get(self, *, timeout: Timeout = 'short') -> Version | None:
5353
"""Return information about the Actor version.
5454
5555
https://docs.apify.com/api/v2#/reference/actors/version-object/get-version
@@ -76,7 +76,7 @@ def update(
7676
git_repo_url: str | None = None,
7777
tarball_url: str | None = None,
7878
github_gist_url: str | None = None,
79-
timeout: Timeout = 'long',
79+
timeout: Timeout = 'short',
8080
) -> Version:
8181
"""Update the Actor version with specified fields.
8282
@@ -115,7 +115,7 @@ def update(
115115
result = self._update(timeout=timeout, **version_fields.model_dump(by_alias=True, exclude_none=True))
116116
return VersionResponse.model_validate(result).data
117117

118-
def delete(self, *, timeout: Timeout = 'long') -> None:
118+
def delete(self, *, timeout: Timeout = 'short') -> None:
119119
"""Delete the Actor version.
120120
121121
https://docs.apify.com/api/v2#/reference/actors/version-object/delete-version
@@ -165,7 +165,7 @@ def __init__(
165165
**kwargs,
166166
)
167167

168-
async def get(self, *, timeout: Timeout = 'long') -> Version | None:
168+
async def get(self, *, timeout: Timeout = 'short') -> Version | None:
169169
"""Return information about the Actor version.
170170
171171
https://docs.apify.com/api/v2#/reference/actors/version-object/get-version
@@ -192,7 +192,7 @@ async def update(
192192
git_repo_url: str | None = None,
193193
tarball_url: str | None = None,
194194
github_gist_url: str | None = None,
195-
timeout: Timeout = 'long',
195+
timeout: Timeout = 'short',
196196
) -> Version:
197197
"""Update the Actor version with specified fields.
198198
@@ -231,7 +231,7 @@ async def update(
231231
result = await self._update(timeout=timeout, **version_fields.model_dump(by_alias=True, exclude_none=True))
232232
return VersionResponse.model_validate(result).data
233233

234-
async def delete(self, *, timeout: Timeout = 'long') -> None:
234+
async def delete(self, *, timeout: Timeout = 'short') -> None:
235235
"""Delete the Actor version.
236236
237237
https://docs.apify.com/api/v2#/reference/actors/version-object/delete-version

src/apify_client/_resource_clients/actor_version_collection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(
4444
**kwargs,
4545
)
4646

47-
def list(self, *, timeout: Timeout = 'long') -> ListOfVersions:
47+
def list(self, *, timeout: Timeout = 'short') -> ListOfVersions:
4848
"""List the available Actor versions.
4949
5050
https://docs.apify.com/api/v2#/reference/actors/version-collection/get-list-of-versions
@@ -70,7 +70,7 @@ def create(
7070
git_repo_url: str | None = None,
7171
tarball_url: str | None = None,
7272
github_gist_url: str | None = None,
73-
timeout: Timeout = 'long',
73+
timeout: Timeout = 'short',
7474
) -> Version:
7575
"""Create a new Actor version.
7676
@@ -131,7 +131,7 @@ def __init__(
131131
**kwargs,
132132
)
133133

134-
async def list(self, *, timeout: Timeout = 'long') -> ListOfVersions:
134+
async def list(self, *, timeout: Timeout = 'short') -> ListOfVersions:
135135
"""List the available Actor versions.
136136
137137
https://docs.apify.com/api/v2#/reference/actors/version-collection/get-list-of-versions
@@ -157,7 +157,7 @@ async def create(
157157
git_repo_url: str | None = None,
158158
tarball_url: str | None = None,
159159
github_gist_url: str | None = None,
160-
timeout: Timeout = 'long',
160+
timeout: Timeout = 'short',
161161
) -> Version:
162162
"""Create a new Actor version.
163163

0 commit comments

Comments
 (0)