@@ -77,7 +77,7 @@ async def main() -> None:
7777 assert run_result is not None
7878 assert run_result ['status' ] == 'SUCCEEDED'
7979
80- output_record = await actor .last_run ().key_value_store ().get_record ('OUTPUT' )
80+ output_record = await ( await actor .last_run () ).key_value_store ().get_record ('OUTPUT' )
8181 assert output_record is not None
8282 assert output_record ['value' ] == 'TESTING-OUTPUT'
8383
@@ -125,7 +125,7 @@ async def main_outer() -> None:
125125
126126 await Actor .start (inner_actor_id , run_input = {'test_value' : test_value })
127127
128- inner_run_status = await Actor .apify_client .actor (inner_actor_id ).last_run ().get ()
128+ inner_run_status = await ( await Actor .apify_client .actor (inner_actor_id ).last_run () ).get ()
129129 assert inner_run_status is not None
130130 assert inner_run_status .get ('status' ) in ['READY' , 'RUNNING' ]
131131
@@ -140,9 +140,9 @@ async def main_outer() -> None:
140140 assert outer_run_result is not None
141141 assert outer_run_result ['status' ] == 'SUCCEEDED'
142142
143- await inner_actor .last_run ().wait_for_finish ()
143+ await ( await inner_actor .last_run () ).wait_for_finish ()
144144
145- inner_output_record = await inner_actor .last_run ().key_value_store ().get_record ('OUTPUT' )
145+ inner_output_record = await ( await inner_actor .last_run () ).key_value_store ().get_record ('OUTPUT' )
146146 assert inner_output_record is not None
147147 assert inner_output_record ['value' ] == f'{ test_value } _XXX_{ test_value } '
148148
@@ -181,9 +181,9 @@ async def main_outer() -> None:
181181 assert outer_run_result is not None
182182 assert outer_run_result ['status' ] == 'SUCCEEDED'
183183
184- await inner_actor .last_run ().wait_for_finish ()
184+ await ( await inner_actor .last_run () ).wait_for_finish ()
185185
186- inner_output_record = await inner_actor .last_run ().key_value_store ().get_record ('OUTPUT' )
186+ inner_output_record = await ( await inner_actor .last_run () ).key_value_store ().get_record ('OUTPUT' )
187187 assert inner_output_record is not None
188188 assert inner_output_record ['value' ] == f'{ test_value } _XXX_{ test_value } '
189189
@@ -231,9 +231,9 @@ async def main_outer() -> None:
231231 assert outer_run_result is not None
232232 assert outer_run_result ['status' ] == 'SUCCEEDED'
233233
234- await inner_actor .last_run ().wait_for_finish ()
234+ await ( await inner_actor .last_run () ).wait_for_finish ()
235235
236- inner_output_record = await inner_actor .last_run ().key_value_store ().get_record ('OUTPUT' )
236+ inner_output_record = await ( await inner_actor .last_run () ).key_value_store ().get_record ('OUTPUT' )
237237 assert inner_output_record is not None
238238 assert inner_output_record ['value' ] == f'{ test_value } _XXX_{ test_value } '
239239
@@ -267,12 +267,12 @@ async def main_outer() -> None:
267267 assert outer_run_result is not None
268268 assert outer_run_result ['status' ] == 'SUCCEEDED'
269269
270- await inner_actor .last_run ().wait_for_finish ()
271- inner_actor_last_run = await inner_actor .last_run ().get ()
270+ await ( await inner_actor .last_run () ).wait_for_finish ()
271+ inner_actor_last_run = await ( await inner_actor .last_run () ).get ()
272272 assert inner_actor_last_run is not None
273273 assert inner_actor_last_run ['status' ] == 'ABORTED'
274274
275- inner_output_record = await inner_actor .last_run ().key_value_store ().get_record ('OUTPUT' )
275+ inner_output_record = ( await inner_actor .last_run () ).key_value_store ().get_record ('OUTPUT' )
276276 assert inner_output_record is None
277277
278278
@@ -320,7 +320,7 @@ async def main_outer() -> None:
320320 assert outer_run_result is not None
321321 assert outer_run_result ['status' ] == 'SUCCEEDED'
322322
323- outer_run_key_value_store = outer_actor .last_run ().key_value_store ()
323+ outer_run_key_value_store = ( await outer_actor .last_run () ).key_value_store ()
324324
325325 outer_output_record = await outer_run_key_value_store .get_record ('OUTPUT' )
326326 assert outer_output_record is not None
@@ -329,7 +329,7 @@ async def main_outer() -> None:
329329 assert await outer_run_key_value_store .get_record ('RECORD_AFTER_METAMORPH_CALL' ) is None
330330
331331 # After metamorph, the run still belongs to the original actor, so the inner one should have no runs
332- assert await inner_actor .last_run ().get () is None
332+ assert ( await inner_actor .last_run () ).get () is None
333333
334334
335335class TestActorReboot :
@@ -353,10 +353,10 @@ async def main() -> None:
353353 assert run_result is not None
354354 assert run_result ['status' ] == 'SUCCEEDED'
355355
356- not_written_value = await actor .last_run ().key_value_store ().get_record ('THIS_KEY_SHOULD_NOT_BE_WRITTEN' )
356+ not_written_value = await ( await actor .last_run () ).key_value_store ().get_record ('THIS_KEY_SHOULD_NOT_BE_WRITTEN' )
357357 assert not_written_value is None
358358
359- reboot_counter = await actor .last_run ().key_value_store ().get_record ('reboot_counter' )
359+ reboot_counter = await ( await actor .last_run () ).key_value_store ().get_record ('reboot_counter' )
360360 assert reboot_counter is not None
361361 assert reboot_counter ['value' ] == 2
362362
@@ -419,20 +419,20 @@ async def main_client() -> None:
419419 server_actor_container_url = server_actor_run ['containerUrl' ]
420420
421421 # Give the server actor some time to start running
422- server_actor_initialized = await server_actor .last_run ().key_value_store ().get_record ('INITIALIZED' )
422+ server_actor_initialized = await ( await server_actor .last_run () ).key_value_store ().get_record ('INITIALIZED' )
423423 while not server_actor_initialized :
424- server_actor_initialized = await server_actor .last_run ().key_value_store ().get_record ('INITIALIZED' )
424+ server_actor_initialized = await ( await server_actor .last_run () ).key_value_store ().get_record ('INITIALIZED' )
425425 await asyncio .sleep (1 )
426426
427427 client_actor_run_result = await client_actor .call (run_input = {'server_actor_container_url' : server_actor_container_url })
428428 assert client_actor_run_result is not None
429429 assert client_actor_run_result ['status' ] == 'SUCCEEDED'
430430
431- server_actor_run_result = await server_actor .last_run ().wait_for_finish ()
431+ server_actor_run_result = await ( await server_actor .last_run () ).wait_for_finish ()
432432 assert server_actor_run_result is not None
433433 assert server_actor_run_result ['status' ] == 'SUCCEEDED'
434434
435- webhook_body_record = await server_actor .last_run ().key_value_store ().get_record ('WEBHOOK_BODY' )
435+ webhook_body_record = await ( await server_actor .last_run () ).key_value_store ().get_record ('WEBHOOK_BODY' )
436436 assert webhook_body_record is not None
437437 assert webhook_body_record ['value' ] != ''
438438 parsed_webhook_body = json .loads (webhook_body_record ['value' ])
0 commit comments