Skip to main content

Jobs

Define and run user code (JAR or Python) on Onehouse compute clusters. Includes JAR upload helpers.

Methods​

MethodDescription
create_jobDefine a job (does not run it)
create_and_run_jobDefine a job and trigger it immediately
alter_jobChange a job's cluster or parameters
delete_jobDelete a job
run_jobTrigger an existing job
cancel_job_runCancel an in-flight job run
describe_jobShow full configuration for a job
describe_job_runShow details of one job run
show_jobsList all jobs in the project
show_runs_in_jobList runs for one job
upload_jarUpload a JAR for use by jobs
replace_jarReplace an existing JAR
describe_jarShow details for one uploaded JAR
delete_jarDelete an uploaded JAR
show_jarsList 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,
)
ParameterRequiredType / values
nameyesstr
typeyes"JAR", "PYTHON"
parametersyesSequence[str] — argv-style parameters passed to the job
clusteryesstr
max_concurrent_runsnoint, 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,
)
ParameterRequiredType / values
nameyesstr
argumentsnoSequence[str] — arguments for this run only, overriding the job's parameters
idempotency_keynostr — 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,
)
ParameterRequiredType / values
job_run_idyesstr (positional) — UUID of the run
job_nameyesstr

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()