Skip to main content
These methods are available in ThinkPlatform-client 0.6.133 and later. Your project needs a configured SQL warehouse and permission for the intended operation. Select your project with a saved work profile as described in Authentication.

Submit a read-only statement

Save the returned ID. wait_timeout="0s" requests immediate submission status, so the statement may still be pending or running. The sample returns one value when successful; it does not create or change a table.

Check status and read results

Set THINKPLATFORM_STATEMENT_ID to your returned ID, then inspect it in a later call:
For the sample query, check that the successful result contains the value 1. Native SQL results can represent numbers as strings. Inspect manifest for column and result metadata instead of assuming Python numeric types. If next_chunk_index is present, call client.lakehouse.statements.result_chunk(statement_id, next_chunk_index) and continue using each returned next index. A first chunk is not a complete multi-chunk result. Bound polling and chunk collection for your application, and retain the statement ID if it does not finish within that bound. Avoid resubmitting SQL merely because a status or connection request timed out. To request cancellation, call client.lakehouse.statements.cancel(statement_id), then inspect the returned state and later status if necessary. A cancellation request does not prove a query stopped before all of its effects.

Parameters and Hosted Apps

execute() also accepts typed LakehouseStatementParameter values and an optional schema; see the API reference. Bind untrusted values through parameters rather than interpolating them into SQL. A Hosted App with --lakehouse-read uses the same statement methods through request-bound SDK access. That grant is read-only and does not permit SQL writes. Inspect or poll only during a valid authenticated app request. For recurring Databricks jobs, inspect tp lakehouse jobs schedule --help. It accepts a Quartz schedule, timezone, pause state, or explicit removal. This is a Lakehouse job schedule; ThinkPlatform scheduled automations are configured separately.