MCPcopy Create free account
hub / github.com/andre-salvati/databricks-template / run_sql

Function run_sql

scripts/_sdk_sql.py:33–41  ·  view source on GitHub ↗
(workspace: WorkspaceClient, warehouse_id: str, sql: str)

Source from the content-addressed store, hash-verified

31
32
33def run_sql(workspace: WorkspaceClient, warehouse_id: str, sql: str) -> None:
34 print(f" Running: {sql}")
35 result = workspace.statement_execution.execute_statement(
36 warehouse_id=warehouse_id,
37 statement=sql,
38 wait_timeout="50s",
39 )
40 if result.status.state != StatementState.SUCCEEDED:
41 raise RuntimeError(f"Statement failed ({result.status.state}): {result.status.error}")

Callers 3

create_service_principalFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected