kumoai.pquery.TrainingTableJob#

class kumoai.pquery.TrainingTableJob[source]#

Bases: KumoFuture[TrainingTable]

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

import kumoai

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

# If a training table is generated in nonblocking mode, the response
# will be of type `TrainingTableJob`:
training_table_job = pquery.generate_training_table(non_blocking=True)

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

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

# Attach to the job, and poll progress updates:
training_table_job.attach()

# Cancel the job:
training_table_job.cancel()

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

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

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

The unique ID of this training 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:

TrainingTable

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 training table generation job.

Return type:

JobStatusReport

attach()[source]#

Allows a user to observe the status of the future while it is not complete.

Return type:

TrainingTable

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

cancel()[source]#

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

Return type:

None

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