Job

class beneath.Job[source]

Job represents a warehouse (OLAP) SQL query job. Unlike index queries, warehouse queries take seconds or minutes to execute, so we use a Job to follow their progress until we can fetch the results.

referenced_instance_ids: List[uuid.UUID]

The IDs of the table instances referenced in the query

job_id: bytes

The unique job identifier

schema: Schema

The schema of the query result

status: JobStatus

The current status of the job

bytes_scanned: int

The number of bytes scanned by the query

result_size_bytes: int

The number of bytes in the query result (not always accurate)

result_size_records: int

The number of records in the query result (not always accurate)

async poll()[source]

Polls for updates to the job. Throws an exception if the job errored.

async get_cursor()beneath.cursor.Cursor[source]

Returns a cursor for paging through the query results

class beneath.JobStatus[source]

Represents the status of a Job

pending = 'pending'

Query is waiting to be scheduled

running = 'running'

Query is running

done = 'done'

Query has finished running