@@ -711,8 +711,8 @@ async def start(
711711 memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit specified
712712 in the default run configuration for the Actor.
713713 timeout: Optional timeout for the run, in seconds. By default, the run uses timeout specified in
714- the default run configuration for the Actor. Using `RemainingTime` will set timeout of the other actor
715- to the time remaining from this actor timeout.
714+ the default run configuration for the Actor. Using `RemainingTime` will set timeout of the other Actor
715+ to the time remaining from this Actor timeout.
716716 wait_for_finish: The maximum number of seconds the server waits for the run to finish. By default,
717717 it is 0, the maximum value is 300.
718718 webhooks: Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) associated with
@@ -740,9 +740,7 @@ async def start(
740740 elif isinstance (timeout , timedelta ):
741741 actor_start_timeout = timeout
742742 else :
743- raise ValueError (
744- f'Invalid timeout { timeout !r} : expected `None`, `"RemainingTime"`, or a `timedelta`.'
745- )
743+ raise ValueError (f'Invalid timeout { timeout !r} : expected `None`, `"RemainingTime"`, or a `timedelta`.' )
746744
747745 api_result = await client .actor (actor_id ).start (
748746 run_input = run_input ,
@@ -761,7 +759,11 @@ def _get_remaining_time(self) -> timedelta | None:
761759 if self .is_at_home () and self .configuration .timeout_at :
762760 return self .configuration .timeout_at - datetime .now (tz = timezone .utc )
763761
764- self .log .warning ('Using `RemainingTime` argument for timeout outside of the Apify platform. Returning `None`' )
762+ self .log .warning (
763+ 'Returning `None` instead of remaining time. Using `RemainingTime` argument is only possible when the Actor'
764+ ' is running on the Apify platform and when the timeout for the Actor run is set. '
765+ f'{ self .is_at_home ()= } , { self .configuration .timeout_at = } '
766+ )
765767 return None
766768
767769 async def abort (
@@ -825,8 +827,8 @@ async def call(
825827 memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit specified
826828 in the default run configuration for the Actor.
827829 timeout: Optional timeout for the run, in seconds. By default, the run uses timeout specified in
828- the default run configuration for the Actor. Using `RemainingTime` will set timeout of the other actor
829- to the time remaining from this actor timeout.
830+ the default run configuration for the Actor. Using `RemainingTime` will set timeout of the other Actor
831+ to the time remaining from this Actor timeout.
830832 webhooks: Optional webhooks (https://docs.apify.com/webhooks) associated with the Actor run, which can
831833 be used to receive a notification, e.g. when the Actor finished or failed. If you already have
832834 a webhook set up for the Actor, you do not have to add it again here.
@@ -849,12 +851,12 @@ async def call(
849851
850852 if timeout == 'RemainingTime' :
851853 actor_call_timeout = self ._get_remaining_time ()
852- elif isinstance (timeout , str ):
853- raise ValueError (
854- f'`timeout` can be `None`, `RemainingTime` literal or `timedelta` instance, but is { timeout = } '
855- )
856- else :
854+ elif timeout is None :
855+ actor_call_timeout = None
856+ elif isinstance (timeout , timedelta ):
857857 actor_call_timeout = timeout
858+ else :
859+ raise ValueError (f'Invalid timeout { timeout !r} : expected `None`, `"RemainingTime"`, or a `timedelta`.' )
858860
859861 api_result = await client .actor (actor_id ).call (
860862 run_input = run_input ,
0 commit comments