Skip to content

Commit 45226a6

Browse files
committed
Fix remaining return types
1 parent eb4284b commit 45226a6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/apify/_actor.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ async def add_webhook(
818818
ignore_ssl_errors: bool | None = None,
819819
do_not_retry: bool | None = None,
820820
idempotency_key: str | None = None,
821-
) -> dict | None:
821+
) -> None:
822822
"""Create an ad-hoc webhook for the current Actor run.
823823
824824
This webhook lets you receive a notification when the Actor run finished or failed.
@@ -842,13 +842,13 @@ async def add_webhook(
842842

843843
if not self.is_at_home():
844844
self.log.error('Actor.add_webhook() is only supported when running on the Apify platform.')
845-
return None
845+
return
846846

847847
# If is_at_home() is True, config.actor_run_id is always set
848848
if not self._configuration.actor_run_id:
849849
raise RuntimeError('actor_run_id cannot be None when running on the Apify platform.')
850850

851-
return await self._apify_client.webhooks().create(
851+
await self._apify_client.webhooks().create(
852852
actor_run_id=self._configuration.actor_run_id,
853853
event_types=webhook.event_types,
854854
request_url=webhook.request_url,
@@ -863,7 +863,7 @@ async def set_status_message(
863863
status_message: str,
864864
*,
865865
is_terminal: bool | None = None,
866-
) -> dict | None:
866+
) -> ActorRun | None:
867867
"""Set the status message for the current Actor run.
868868
869869
Args:
@@ -884,8 +884,10 @@ async def set_status_message(
884884
if not self._configuration.actor_run_id:
885885
raise RuntimeError('actor_run_id cannot be None when running on the Apify platform.')
886886

887-
return await self._apify_client.run(self._configuration.actor_run_id).update(
888-
status_message=status_message, is_status_message_terminal=is_terminal
887+
return ActorRun.model_validate(
888+
await self._apify_client.run(self._configuration.actor_run_id).update(
889+
status_message=status_message, is_status_message_terminal=is_terminal
890+
)
889891
)
890892

891893
async def create_proxy_configuration(

0 commit comments

Comments
 (0)