kumoai.pquery.TrainingTableJob#
- class kumoai.pquery.TrainingTableJob[source]#
Bases:
JobInterface
[str
,GenerateTrainTableRequest
,GenerateTrainTableJobResource
],KumoProgressFuture
[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.
- 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:
- future()[source]#
Returns the
concurrent.futures.Future
object wrapped by this future. It is not recommended to access this object directly.- Return type:
Future
[TrainingTable
]
- status()[source]#
Returns the status of a running training table generation job.
- Return type:
JobStatusReport
- cancel()[source]#
Cancels a running training table generation job, and raises an error if cancellation failed.
- Return type:
- load_config()[source]#
Load the full configuration for this training table generation job.
- Returns:
Complete configuration including plan, pquery_id, graph_snapshot_id, etc.
- Return type:
GenerateTrainTableRequest
- attach(interval_s=4.0)#
Allows a user to attach to a running job and view its progress.
- delete_tags(tags)#
Removes the tags from the job.
- done()#
Returns
True
if this future has been resolved withresult()
, orFalse
if this future is still in-progress. Note that this method will returnTrue
if the future is complete, but in a failed state, and that this method will returnFalse
if the job is complete, but the future has not been awaited.- Return type:
- classmethod search_by_tags(tags, limit=10)#
Returns a list of job instances from a set of job tags.
- Parameters:
- Return type:
list
[Self
]
Example
>>> tags = {'pquery_name': 'my_pquery_name'} >>> jobs = BatchPredictionJob.search_by_tags(tags) Search limited to 10 results based on the `limit` parameter. Found 2 jobs.