Skip to main content

Typed helpers

OnehouseResources exposes 52 typed helper methods across 13 resource families. Each one wraps execute() and builds the SQL for you, with input validation and enum checking.

Resource families

FamilyPage
ClustersClusters
LakesLakes
DatabasesDatabases
TablesTables
CatalogsCatalogs
SourcesSources
FlowsFlows
TransformationsTransformations
ValidationsValidations
Table servicesTable services
JobsJobs
Service principalsService principals
API tokensAPI tokens

Common parameters

Every typed helper accepts the same trailing keyword arguments:

ParameterTypeDefaultDescription
unsafe_rawboolFalseBypass input validation (resource name regex, enum checks). Use only when the SDK's validation is wrong for your case.
timeoutfloat | NoneNone — falls back to the client's default_execute_timeout (60.0 seconds out of the box)Total seconds to wait for a terminal status.
poll_intervalfloat | NoneNone — falls back to the client's default_poll_interval (1.0 second, then 1.5× backoff up to 10.0 s)Initial seconds between status polls.

Passing timeout=None / poll_interval=None (the parameter default) means "use the client's default" — not "wait forever". To change the defaults for every call, configure them on the client:

client = OnehouseResources(
default_execute_timeout=300.0, # default for all blocking calls
default_poll_interval=2.0,
)

See Error handling — Tuning timeout and poll interval for the full set of knobs.

All methods return a StatusResponse. See Execution modes for how blocking semantics work and Error handling for exceptions.

What's not covered

ACL, privilege, role, and group commands aren't exposed as typed helpers yet — use client.execute("GRANT ...") until they land in a future release.

unsafe_raw escape hatch

The builder validates resource names against ^[A-Za-z][A-Za-z0-9_-]*$ and rejects unknown enum values to catch obvious typos. If a name doesn't match (e.g. legacy resources with dots in the name) or you're using a SQL feature the SDK hasn't been updated for, pass unsafe_raw=True on the call to skip validation:

client.create_cluster("legacy.name", type="CustomType", unsafe_raw=True)

The argument is deliberately named so its uses are easy to find with grep.