Wrap Up

Databricks with the Python SDK

Avi Steinberg

Senior Software Engineer

Query AI models using Databricks

WorkspaceClient.serving_endpoints.query()
Databricks with the Python SDK

Query AI models to run SQL on Databricks data

SQLDatabase.from_databricks(catalog, schema, warehouse_id)
SQLDatabaseToolkit(db, llm)
create_sql_agent(llm, toolkit, verbose)
agent.run("your question..")
Databricks with the Python SDK

Create and manage clusters

w.clusters.create(spark_version, cluster_name)
w.clusters.delete(cluster_id)
w.clusters.start(cluster_id)
w.clusters.get(cluster_id)
Databricks with the Python SDK

Create and manage jobs

w.jobs.create(
    name, 
    tasks=[
      jobs.Task(
          description,
          notebook_task=jobs.NotebookTask(notebook_path),
          task_key
          )
    ],
    schedule=jobs.CronSchedule(quartz_cron_expression,timezone_id),
    timeout_seconds, 
)
Databricks with the Python SDK

Bringing it all together

Databricks Job and AI Model

Databricks with the Python SDK

Congratulations!

Databricks with the Python SDK

Preparing Video For Download...