Jobs API
Listing jobs
The List Jobs API returns the jobs that you have started. Jobs are scoped to
a workspace, so listing is available in two places:
workspace.jobs.list()returns only the jobs belonging to that workspace.client.jobs.list()returns your jobs across every workspace you can access.
- Python
Both variants share the same signature and accept the optional arguments
feature_set_name_query, status_filter, and job_type_filters. The
job_type_filters argument takes a list of job type string values, and
feature_set_name_query is matched as a case-insensitive regular expression
against the feature set name. list() returns a generator, so it can be
iterated directly.
from h2o_featurestore import JobType
workspace = client.workspaces.get("ws-abc123")
# Jobs within a single workspace (preferred)
for job in workspace.jobs.list():
print(job)
# Filter by job type
for job in workspace.jobs.list(job_type_filters=[JobType.INGEST.value]):
print(job)
# Filter by feature set name and status
for job in workspace.jobs.list(feature_set_name_query="transactions", status_filter="Running"):
print(job)
# Across all accessible workspaces
for job in client.jobs.list(job_type_filters=[JobType.INGEST.value]):
print(job)
Available JobType values:
JobType.BACKFILLJobType.BATCH_RETRIEVEJobType.COMPUTE_RECOMMENDATION_CLASSIFIERSJobType.COMPUTE_STATISTICSJobType.EXTRACT_SCHEMAJobType.INGESTJobType.MATERIALIZATION_ONLINEJobType.OPTIMIZE_STORAGEJobType.RETRIEVEJobType.REVERT_INGESTJobType.UNKNOWN
Available status_filter values:
CreatedSubmittedPendingPendingRerunRunningFailingFailedSubmissionFailedSuccessCancellingCancelled
list() returns jobs of every status. To restrict the results to jobs that are
currently executing, pass status_filter="Running". Active-style filtering is
also available per feature set via
feature_set.get_active_jobs(job_type=..., active=...). Unlike list(),
get_active_jobs accepts either the JobType enum member directly
(JobType.INGEST) or its string value (JobType.INGEST.value);
job_type_filters only accepts string values.
Only top-level jobs are listed. Jobs spawned by another job are not returned as
separate entries — they are available through the parent job's childJobIds.
Getting a job
- Python
job = client.jobs.get("job_id")
# The workspace-scoped variant returns the same job, already bound to the workspace
job = workspace.jobs.get("job_id")
Job workspace
Every job belongs to the workspace that contains the feature set it operates on.
- Python
# Resource name of the owning workspace, for example "workspaces/ws-abc123"
job.parent
# The Workspace object, resolved lazily from the resource name
job.workspace
Jobs created before workspace scoping was introduced do not belong to a specific workspace. For these jobs, parent is an empty string and workspace is None.
Cancelling a job
To request cancel without waiting for cancellation to complete you need to call
- Python
job.cancel()
To request cancel and wait for cancellation to complete you need to call
- Python
job.cancel(wait_for_completion=True)
Checking job status
- Python
job.done
Checking if job is cancelled
- Python
job.cancelled
Getting job results
- Python
job.get_result()
Checking job metrics
- Python
job.get_metrics()
Downloading retrieved data
- Python
To download retrieved data, use the RetrieveResult returned by
feature_set.retrieve() and call its download() (or download_async())
method. See the Retrieve API for details.
data_path = fs.retrieve().download()
Waiting for a job result
- Python
You can block until a job completes and obtain its result using
wait_for_result(poll_interval=2.0, timeout=None). Job status is
available through the job_status and error_message properties.
result = job.wait_for_result(poll_interval=2.0, timeout=None)
job.job_status
job.error_message
Job metadata
| Field Name | User Modifiable | Values |
|---|---|---|
| id | No | - |
| jobType | No | Ingest, Retrieve, BatchRetrieve, ExtractSchema, MaterializationOnline, ComputeStatistics, Backfill, OptimizeStorage, ComputeRecommendationClassifiers, Revert |
| done | No | true, false |
| cancelled | No | true, false |
| childJobIds | No | Child job ids |
| parent | No | Resource name of the owning workspace, or empty for jobs created before workspace scoping |
The done parameter indicates that the job has completed its execution and the results are available.
Permissions
Managing a job requires the owner or editor role, held either on the workspace that contains the feature set or on the feature set itself. This applies to:
- Cancelling a job
- Retrieving a job and listing the jobs of a feature set
- Scheduling storage optimization
Starting an ingestion requires editor permission on the feature set. See Permissions for the full role model.
workspace.jobs.list() and client.jobs.list() are not gated by these roles,
because they only ever return jobs that you started yourself.
- Submit and view feedback for this page
- Send feedback about H2O Feature Store to cloud-feedback@h2o.ai