Skip to main content

Typed helpers

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

Resource families​

FamilyPage
Clusters and OCU limitClusters
LakesLakes
DatabasesDatabases
TablesTables
CatalogsCatalogs
SourcesSources
FlowsFlows
TransformationsTransformations
ValidationsValidations
Table servicesTable services
Jobs and JARsJobs
Service principalsService principals
API tokensAPI tokens
GroupsGroups
PoliciesPolicies
Grants and rolesGrants and roles

Common parameters​

Every typed helper accepts the same trailing keyword arguments. unsafe_raw is not accepted by the grants and roles methods, reset_policies, alter_ocu_limit, or the show_* methods that take no other 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.

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.