Repository navigation
Commit d382995
authored
feat: add
`Actor.child_runs` is a sync property that maps each run name to a
`RunClientAsync` for the current run under that name. It has the same
shape as `Actor.childRuns` in the JS SDK (apify/apify-sdk-js#759). The
client covers the run and its storages:
```python
run = await Actor.child_runs['scrape-eu'].wait_for_finish()
```
The SDK reads the registry from the default key-value store when the
Actor initializes, so runs recorded before a migration or resurrection
are included and reading the property makes no API calls. That adds one
record read to every init. A malformed record fails the init and leaves
the Actor uninitialized. Runs started without a `run_name` aren't
tracked. Runs that were replaced under a name stay in the `history` of
the `__ACTOR_CHILD_RUNS` record and aren't exposed.
A run started or reattached with a custom `token` gets a client with
that token. A run recorded before a migration and not reattached since
gets the default client, because the token isn't stored.
It also fixes a duplicate `max_items` deprecation warning from #1149: a
named start that resurrects its recorded run no longer warns a second
time from inside the SDK.
Docs are in #1160.
Closes: #1129
*✍️ Drafted by Claude Code*Actor.child_runs with clients for named child runs (#1151)1 parent a036c2d commit d382995
5 files changed
Lines changed: 207 additions & 40 deletions
File tree
- src/apify
- tests
- e2e
- unit/actor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| |||
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
233 | | - | |
234 | | - | |
235 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
236 | 248 | | |
237 | 249 | | |
238 | 250 | | |
| |||
384 | 396 | | |
385 | 397 | | |
386 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
387 | 417 | | |
388 | 418 | | |
389 | 419 | | |
| |||
1026 | 1056 | | |
1027 | 1057 | | |
1028 | 1058 | | |
1029 | | - | |
1030 | 1059 | | |
1031 | 1060 | | |
1032 | 1061 | | |
| |||
1230 | 1259 | | |
1231 | 1260 | | |
1232 | 1261 | | |
1233 | | - | |
1234 | 1262 | | |
1235 | 1263 | | |
1236 | 1264 | | |
| |||
1257 | 1285 | | |
1258 | 1286 | | |
1259 | 1287 | | |
1260 | | - | |
1261 | 1288 | | |
1262 | 1289 | | |
1263 | 1290 | | |
| |||
1272 | 1299 | | |
1273 | 1300 | | |
1274 | 1301 | | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
| 1302 | + | |
1278 | 1303 | | |
| 1304 | + | |
| 1305 | + | |
1279 | 1306 | | |
1280 | 1307 | | |
1281 | 1308 | | |
1282 | | - | |
1283 | | - | |
1284 | 1309 | | |
1285 | 1310 | | |
1286 | 1311 | | |
| |||
1391 | 1416 | | |
1392 | 1417 | | |
1393 | 1418 | | |
1394 | | - | |
1395 | 1419 | | |
1396 | 1420 | | |
1397 | 1421 | | |
| |||
1492 | 1516 | | |
1493 | 1517 | | |
1494 | 1518 | | |
1495 | | - | |
1496 | 1519 | | |
1497 | 1520 | | |
1498 | 1521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| |||
140 | 142 | | |
141 | 143 | | |
142 | 144 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 145 | + | |
148 | 146 | | |
149 | 147 | | |
150 | 148 | | |
151 | 149 | | |
152 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
153 | 156 | | |
154 | 157 | | |
| 158 | + | |
155 | 159 | | |
156 | 160 | | |
157 | 161 | | |
| |||
176 | 180 | | |
177 | 181 | | |
178 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
179 | 198 | | |
180 | 199 | | |
181 | 200 | | |
| |||
203 | 222 | | |
204 | 223 | | |
205 | 224 | | |
206 | | - | |
| 225 | + | |
| 226 | + | |
207 | 227 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
218 | 237 | | |
219 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
220 | 242 | | |
221 | 243 | | |
222 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| |||
0 commit comments