kumoai.pquery.PredictionTableJob#

class kumoai.pquery.PredictionTableJob[source]#

Bases: KumoFuture[PredictionTable]

A representation of an ongoing prediction table generation job in the Kumo platform.

import kumoai

# See `PredictiveQuery` documentation:
pquery = kumoai.PredictiveQuery(...)

# If a prediction table is generated in nonblocking mode, the response
# will be of type `PredictionTableJob`:
prediction_table_job = pquery.generate_prediction_table(non_blocking=True)

# You can also construct a `PredictionTableJob` from a job ID, e.g.
# one that is present in the Kumo Jobs page:
prediction_table_job = kumoai.PredictionTableJob("gen-predtable-job-...")

# Get the status of the job:
print(prediction_table_job.status())

# Cancel the job:
prediction_table_job.cancel()

# Wait for the job to complete, and return a `PredictionTable`:
prediction_table_job.result()
Parameters:

job_id (str) – ID of the prediction table generation job.

__init__(job_id)[source]#
property id: str#

The unique ID of this prediction table generation process.

result()[source]#

Returns the resolved state of the future.

Raises:

Exception – If the future is complete but in a failed state due to an exception being raised, this method will raise the same exception.

Return type:

PredictionTable

future()[source]#

Returns the concurrent.futures.Future object wrapped by this future. It is not recommended to access this object directly.

status()[source]#

Returns the status of a running prediction table generation job.

Return type:

JobStatusReport

cancel()[source]#

Cancels a running prediction table generation job, and raises an error if cancellation failed.

Return type:

None

delete_tags(tags)[source]#

Removes the tags from the job.

Parameters:

tags (List[str]) – The tags to remove.

Return type:

bool

update_tags(tags)[source]#

Updates the tags of the job.

Parameters:

tags (Mapping[str, Optional[str]]) – The tags to update. Note that the value ‘none’ will remove the tag. If the tag is not present, it will be added.

Return type:

bool

static __new__(cls, *args, **kwds)#
done()#

Returns True if this future has been resolved with result(), or False if this future is still in-progress. Note that this method will return True if the future is complete, but in a failed state, and that this method will return False if the job is complete, but the future has not been awaited.

Return type:

bool