JobsClientSync
JobsClientSync(gateway: JobsGatewaySync, *, config: "Config | None" = None)Synchronous jobs client (public API for connect_sync()).
Methods
.close()
JobsClientSync.close() -> NoneClose underlying resources (best-effort).
Current sync jobs/transactions gateways are lightweight wrappers over shared SQL/HTTP transports and typically have nothing to close directly.
Returns:
None- Always returnsNone.
.get()
JobsClientSync.get( reasoner_type: str, job_id: str, *, include: JobIncludeDict | None = None) -> Job | NoneGet a normalized job/transaction by (reasoner_type, job_id).
By default returns a stable common schema. Use include= to opt into
backend-specific expansions (e.g. details, events, artifacts, problems, raw).
Returns:
Job|None- The job/transaction, orNoneif not found.
Referenced By:
RelationalAI Documentation └── Build With RelationalAI └── Understand how PyRel works > Use advanced reasoning > Predictive reasoning └── Monitor training └── Manage a training job
.create()
JobsClientSync.create( reasoner_type: str, reasoner_name: str, payload: dict[str, Any], *, timeout_mins: int | None = None) -> JobOperationSyncStart a job/transaction and return a non-blocking operation handle (sync).
Note: reasoner_name identifies which reasoner/worker to run on.
Returns:
JobOperationSync- An operation handle; callop.wait(...)to block for completion.
.create_ready()
JobsClientSync.create_ready( reasoner_type: str, reasoner_name: str, payload: dict[str, Any], *, timeout_mins: int | None = None, timeout_s: float = 900, poll_interval_s: float = 0.5, include: JobIncludeDict | None = None) -> JobCreate a job and block until it reaches a terminal state.
Returns:
Job- The final job/transaction (possibly expanded wheninclude=is provided).
.list()
JobsClientSync.list( reasoner_type: str | None = None, *, job_id: str | None = None, state: str | None = None, name: str | None = None, created_by: str | None = None, only_active: bool = False, all_users: bool = False, limit: int | None = None, offset: int | None = None, include: JobIncludeDict | None = None) -> list[Job]List jobs/transactions, optionally filtered and optionally expanded (sync).
If reasoner_type is None, lists across all supported job types and
merges the results, sorting by created_on (desc).
Returns:
list[Job] - Matching jobs/transactions (possibly expanded wheninclude=is provided).
Referenced By:
RelationalAI Documentation └── Build With RelationalAI └── Understand how PyRel works > Use advanced reasoning > Predictive reasoning └── Monitor training └── Manage a training job
.get_events()
JobsClientSync.get_events( reasoner_type: str, job_id: str, continuation_token: str = "", *, stream_name: str = "progress") -> JobEventsGet events for a job or transaction.
Works for all reasoner types and backends:
- LOGIC (DA):
GET /v1alpha1/transactions/{txn_id}/events/{stream_name} - LOGIC (SQL):
{app}.api.get_own_transaction_events(txn_id, continuation_token) - Non-LOGIC (DA):
GET /v1alpha1/jobs/{job_type}/{job_id}/events/{stream_name} - Non-LOGIC (SQL):
{app}.api.GET_JOB_EVENTS(reasoner_type, job_id, token)
Returns:
JobEvents- Event page includingeventsand an optionalcontinuation_token.
Referenced By:
RelationalAI Documentation └── Build With RelationalAI └── Understand how PyRel works > Use advanced reasoning > Predictive reasoning └── Monitor training └── Manage a training job
.cancel()
JobsClientSync.cancel(reasoner_type: str, job_id: str, *, all_users: bool = False) -> NoneCancel a running job/transaction (sync).
Cancellation is supported for both non-LOGIC jobs and LOGIC transactions.
cancel(all_users=True) is only supported for LOGIC transactions; non-LOGIC
jobs reject it.
Returns:
None- Always returnsNone.
Referenced By:
RelationalAI Documentation └── Build With RelationalAI └── Understand how PyRel works > Use advanced reasoning > Predictive reasoning └── Monitor training └── Manage a training job
.wait()
JobsClientSync.wait( reasoner_type: str, job_id: str, *, timeout_s: float = 900, poll_interval_s: float = 0.5, include: JobIncludeDict | None = None) -> JobPoll get(...) until the execution reaches a terminal state (sync).
Raises JobTimeoutError when timeout_s is exceeded.
Returns:
Job- The final job/transaction (possibly expanded wheninclude=is provided).
Referenced By:
RelationalAI Documentation └── Release Notes └── Python API Release Notes └── What’s New in Version 1.0.1 └── New Features and Enhancements
.get_operation()
JobsClientSync.get_operation(reasoner_type: str, job_id: str) -> OperationDerive a normalized operation status from the current job state.
Returns:
Operation- A normalized operation status.
Referenced By
RelationalAI Documentation ├── Build With RelationalAI │ └── Understand how PyRel works > Use advanced reasoning > Predictive reasoning │ └── Monitor training │ └── Manage a training job └── Release Notes └── Python API Release Notes └── What’s New in Version 1.0.1 └── New Features and Enhancements