Jobs
Define and run user code (JAR or Python) on Onehouse compute clusters. Includes JAR upload helpers.
Methods
| Method | Description |
|---|---|
create_job | Define a job (does not run it) |
create_and_run_job | Define a job and trigger it immediately |
alter_job | Change a job's cluster or parameters |
delete_job | Delete a job |
run_job | Trigger an existing job |
cancel_job_run | Cancel an in-flight job run |
describe_job | Show full configuration for a job |
describe_job_run | Show details of one job run |
show_jobs | List all jobs in the project |
show_runs_in_job | List runs for one job |
upload_jar | Upload a JAR for use by jobs |
replace_jar | Replace an existing JAR |
describe_jar | Show details for one uploaded JAR |
delete_jar | Delete an uploaded JAR |
show_jars | List all uploaded JARs in the project |
create_job
create_job(
name: str,
*,
type: str,
parameters: Sequence[str],
cluster: str,
max_concurrent_runs: int | None = None,
unsafe_raw: bool = False,
timeout: float | None = None,
poll_interval: float | None = None,
)
| Parameter | Required | Type / values |
|---|---|---|
name | yes | str |
type | yes | "JAR", "PYTHON" |
parameters | yes | Sequence[str] — argv-style parameters passed to the job |
cluster | yes | str |
max_concurrent_runs | no | int, at least 1 — how many runs of this job may run at once. Omitted from the SQL when not set. |
Example
client.create_job(
"nightly_export",
type="PYTHON",
parameters=["--date", "{{ds}}", "--target", "s3://exports/"],
cluster="batch_cluster",
)
create_and_run_job
Same signature as create_job. Defines the job and triggers it in one call.
Example
client.create_and_run_job(
"ad_hoc_export",
type="PYTHON",
parameters=["--full-refresh"],
cluster="batch_cluster",
)
alter_job
alter_job(
name: str,
*,
cluster: str | None = None,
parameters: Sequence[str] | None = None,
max_concurrent_runs: int | None = None,
unsafe_raw: bool = False,
timeout: float | None = None,
poll_interval: float | None = None,
)
Requires exactly one of cluster, parameters, or max_concurrent_runs. max_concurrent_runs must be at least 1.
Examples
# Move to a different cluster
client.alter_job("nightly_export", cluster="batch_cluster_v2")
# Update parameters
client.alter_job("nightly_export", parameters=["--date", "{{ds}}", "--verbose"])
# Allow up to three runs at once
client.alter_job("nightly_export", max_concurrent_runs=3)
delete_job
delete_job(name: str, *, unsafe_raw=False, timeout=None, poll_interval=None)
Example
client.delete_job("nightly_export")
run_job
run_job(
name: str,
*,
arguments: Sequence[str] | None = None,
idempotency_key: str | None = None,
unsafe_raw: bool = False,
timeout: float | None = None,
poll_interval: float | None = None,
)
| Parameter | Required | Type / values |
|---|---|---|
name | yes | str |
arguments | no | Sequence[str] — arguments for this run only, overriding the job's parameters |
idempotency_key | no | str — sent as the Idempotency-Key header, not in the SQL |
The server deduplicates runs on idempotency_key, so retrying a call with the same key does not start a second run. Use it when the job allows concurrent runs. The key must be a non-empty, printable ASCII string with no leading or trailing whitespace; anything else raises ValueError before the request is sent.
Examples
client.run_job("nightly_export")
client.run_job(
"nightly_export",
arguments=["--date", "2026-10-01"],
idempotency_key="nightly_export-2026-10-01",
)
# RUN JOB `nightly_export`
# ARGUMENTS = ('--date', '2026-10-01')
cancel_job_run
cancel_job_run(
job_run_id: str,
*,
job_name: str,
unsafe_raw: bool = False,
timeout: float | None = None,
poll_interval: float | None = None,
)
| Parameter | Required | Type / values |
|---|---|---|
job_run_id | yes | str (positional) — UUID of the run |
job_name | yes | str |
Example
client.cancel_job_run("3afe72cd-1234-...", job_name="nightly_export")
describe_job
describe_job(name: str, *, unsafe_raw=False, timeout=None, poll_interval=None)
Example
result = client.describe_job("nightly_export")
describe_job_run
describe_job_run(
job_run_id: str,
*,
job_name: str,
unsafe_raw: bool = False,
timeout: float | None = None,
poll_interval: float | None = None,
)
Example
result = client.describe_job_run("3afe72cd-1234-...", job_name="nightly_export")
show_jobs
show_jobs(*, timeout=None, poll_interval=None)
Example
result = client.show_jobs()
show_runs_in_job
show_runs_in_job(name: str, *, unsafe_raw=False, timeout=None, poll_interval=None)
Example
result = client.show_runs_in_job("nightly_export")
upload_jar
upload_jar(
name: str,
*,
options: Mapping[str, str] | None = None,
unsafe_raw: bool = False,
timeout: float | None = None,
poll_interval: float | None = None,
)
Example
client.upload_jar("etl-1.2.0.jar", options={"s3.path": "s3://my-bucket/jars/etl-1.2.0.jar"})
Use s3.path on AWS projects and gcs.path on GCP projects.
replace_jar
replace_jar(
name: str,
*,
options: Mapping[str, str] | None = None,
unsafe_raw: bool = False,
timeout: float | None = None,
poll_interval: float | None = None,
)
Example
client.replace_jar("etl-1.2.0.jar", options={"s3.path": "s3://my-bucket/jars/etl-1.2.1.jar"})
describe_jar
describe_jar(name: str, *, unsafe_raw=False, timeout=None, poll_interval=None)
See DESCRIBE JAR for the response fields.
Example
result = client.describe_jar("my-custom-transformer")
delete_jar
delete_jar(name: str, *, unsafe_raw=False, timeout=None, poll_interval=None)
Fails if any flow still uses the JAR.
Example
client.delete_jar("my-custom-transformer")
show_jars
show_jars(*, timeout=None, poll_interval=None)
Example
result = client.show_jars()