Skip to content

wait_for_finish() and call() return None for a job that is never found #1090

Description

@vdusek

wait_for_finish() on runs and builds returns None when the job is still missing after the 3 s not-found window, or when the deadline passes while the API keeps returning 404 (_resource_clients/_resource_client.py:360-369). actor.call() and task.call() pass that None on. So RunClient.wait_for_finish, BuildClient.wait_for_finish, call() and their async twins are typed Run | None / Build | None, and every caller has to check for None.

The JS client throws in the same situation: it rethrows the API's 404 as a NotFoundError (Actor run was not found, type record-not-found), so its return types are plain ActorRun / Build (apify/apify-client-js#1124).

Expected behavior

Raise NotFoundError when the job can't be found, as the JS client does, and narrow the return types to Run / Build. This changes the return type and turns a None into an exception, so it needs a major release.

✍️ Drafted by Claude Code

Activity

  1. added this to the 3.0 milestone on Oct 7, 2026
  2. added
    t-toolingIssues with this label are in the ownership of the tooling team.
    on Oct 7, 2026
  3. modified the milestones: 3.0, 4.0 on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-toolingIssues with this label are in the ownership of the tooling team.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions