Waiters - Python SDK
Waiters poll until a terminal state, tolerate a bounded number of transient read errors, and raise on failure or timeout.
Overview
Available Operations
| Method | Description |
|---|---|
wait_for_deployment(id, ...) | Wait for RUNNING; fail on FAILED or STOPPED. |
wait_for_training_job(id, ...) | Wait for SUCCEEDED; fail on FAILED or CANCELLED. |
wait_for_evaluation_job(id, ...) | Wait for SUCCEEDED; fail on FAILED or CANCELLED. |
wait_for_dataset_preparation(id, ...) | Wait for the requested rules_ready milestone or completed; fail on ERROR or CANCELLED. |
wait_for_job(id, ...) | Wait for SUCCEEDED; fail on FAILED or CANCELLED. |
wait_for_deployment
Wait for RUNNING; fail on FAILED or STOPPED.
Request
id; optional timeout=1800, interval=5, max_consecutive_errors=3.
Response
Final Deployment dictionary.
wait_for_training_job
Wait for SUCCEEDED; fail on FAILED or CANCELLED.
Request
id; optional timeout=86400, interval=5, max_consecutive_errors=3.
Response
Final Training job dictionary.
wait_for_evaluation_job
Wait for SUCCEEDED; fail on FAILED or CANCELLED.
Request
id; optional timeout=86400, interval=5, max_consecutive_errors=3.
Response
Final Evaluation job dictionary.
wait_for_dataset_preparation
Wait for the requested rules_ready milestone or completed; fail on ERROR or CANCELLED.
Request
id; optional until="completed", timeout=86400, interval=5, max_consecutive_errors=3.
Response
Latest preparation dictionary.
wait_for_job
Wait for SUCCEEDED; fail on FAILED or CANCELLED.
Request
id; optional timeout=86400, interval=5, max_consecutive_errors=3.
Response
Final generic job dictionary.
Field Reference and Examples
OperationFailedError carries the terminal status and full result.
WaitTimeoutError reports the last observed status. Only transient connection
and timeout errors count toward max_consecutive_errors; API and validation
errors fail immediately.
Dataset Preparation uses lowercase wire statuses. Waiting for rules_ready
accepts that milestone and later successful phases; it never treats error or
cancelled as success.
deployment = client.wait_for_deployment(42, timeout=1800, interval=5)
training = client.wait_for_training_job("training-id", timeout=86400)
evaluation = client.wait_for_evaluation_job("evaluation-id", timeout=86400)
rules = client.wait_for_dataset_preparation(17, until="rules_ready")
prepared = client.wait_for_dataset_preparation(17)
job = client.wait_for_job("job-id", timeout=86400)
All methods use the shared authentication and typed error behavior described in Response Conventions and Retry and Security.