Skip to content

Add job management API (list/get/cancel/retry) - #32

Open
sandshoes wants to merge 1 commit into
mainfrom
tommy/protm-2264-job-management-api
Open

sandshoes wants to merge 1 commit into
mainfrom
tommy/protm-2264-job-management-api

Conversation

@sandshoes

Copy link
Copy Markdown
Contributor

Summary

  • Adds a jobs namespace to TinybirdClient (list/get/cancel/retry) and matching TinybirdApi methods (list_jobs/get_job/cancel_job/retry_job) wrapping /v0/jobs.
  • Closes the loop on operations the SDK itself starts (append/replace, connector syncs): previously there was no way to check status, cancel, or retry a job the SDK triggered, unlike tb job ls/details/cancel/retry.
  • list supports optional status/kind filters, matching the /v0/jobs query params.
  • Validation approach for retry: eligibility (job kind/state — import/S3/GCS sync jobs in error or cancelled state) is not duplicated client-side. The request passes straight through and the API's own error (status/message) surfaces via the existing TinybirdError/TinybirdApiError wrapping. This avoids re-implementing server-side business rules in the client that could drift from the API's actual behavior — consistent with how other endpoints in this SDK generally let the API be the source of truth for validity, reserving client-side checks for things the client can know for certain (e.g. mutually exclusive options).

Closes https://linear.app/tinybird/issue/PROTM-2264/python-sdk-add-job-management-api-listgetcancelretry

Checklist

  • CI is green (lint, typecheck, test)
  • pre-commit run --all-files passes locally (gitleaks step fails in this sandbox on an unrelated SSL/network error fetching its environment, not a code issue)
  • Tests were added or updated when behavior changed
  • Public API / typing changes were reviewed
  • Documentation was updated (README.md) with a new "Job Management" section
  • Breaking changes are clearly documented (none — purely additive)
  • CHANGELOG.md was updated when user-facing behavior changed

Adds a `jobs` namespace to `TinybirdClient` and matching `TinybirdApi`
methods wrapping `/v0/jobs`, closing the loop on async jobs the SDK
itself triggers (append/replace, connector syncs), matching
`tb job ls/details/cancel/retry`. Retry eligibility is left to the API
rather than duplicated client-side.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant