You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 99e3cc3
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/04_upgrading/upgrading_to_v4.md
+10-30Lines changed: 10 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,15 +59,11 @@ The SDK is now built on [`apify-client`](https://docs.apify.com/api/client/pytho
59
59
60
60
If you imported the platform environment-variable enums from `apify_shared.consts` (`ApifyEnvVars`, `ActorEnvVars`), import them from `apify` instead — they are now vendored in the SDK and re-exported from the top-level package.
61
61
62
-
**Before (v3.x):**
63
-
64
62
```python
63
+
# Before (v3)
65
64
from apify_shared.consts import ApifyEnvVars
66
-
```
67
-
68
-
**Now (v4.0):**
69
65
70
-
```python
66
+
# After (v4)
71
67
from apify import ApifyEnvVars
72
68
```
73
69
@@ -82,18 +78,14 @@ Generated enum-like types are now [`Literal`](https://docs.python.org/3/library/
82
78
-`apify.WebhookEventType` is now a `Literal[...]` instead of a `StrEnum`. Use plain string values (`'ACTOR.RUN.FAILED'`) instead of enum members.
83
79
-`apify_shared.consts.ActorEventTypes` (a `StrEnum`) is replaced by `apify.ActorEventTypes`, now a `Literal['systemInfo', 'persistState', 'migrating', 'aborting']`. For runtime values, use `apify.Event` (re-exported from Crawlee) instead of enum members.
84
80
85
-
**Before (v3.x):**
86
-
87
81
```python
82
+
# Before (v3)
88
83
from apify import Actor
89
84
from apify_shared.consts import ActorEventTypes
90
85
91
86
Actor.on(ActorEventTypes.SYSTEM_INFO, callback)
92
-
```
93
-
94
-
**Now (v4.0):**
95
87
96
-
```python
88
+
# After (v4)
97
89
from apify import Actor, Event
98
90
99
91
Actor.on(Event.SYSTEM_INFO, callback)
@@ -109,9 +101,8 @@ The `Webhook` model has been slimmed down to only the fields a user sets when de
109
101
110
102
The retry and idempotency kwargs that used to live on `Actor.add_webhook` have moved onto the `Webhook` instance itself.
111
103
112
-
**Before (v3.x):**
113
-
114
104
```python
105
+
# Before (v3)
115
106
from apify import Actor, Webhook
116
107
117
108
await Actor.add_webhook(
@@ -120,11 +111,8 @@ await Actor.add_webhook(
120
111
do_not_retry=False,
121
112
idempotency_key='my-key',
122
113
)
123
-
```
124
114
125
-
**Now (v4.0):**
126
-
127
-
```python
115
+
# After (v4)
128
116
from apify import Actor, Webhook
129
117
130
118
await Actor.add_webhook(
@@ -156,18 +144,14 @@ The `webhooks` argument on `Actor.start`, `Actor.call`, and `Actor.call_task` st
156
144
157
145
Direct `.get(id)` and `.delete(id)` calls still swallow 404 into `None`. But where a 404 could mean either the parent or the sub-resource is missing, the client now raises `NotFoundError` instead of returning `None`.
0 commit comments