一键导入
databricks-notebooks
Work with Databricks notebooks using the REST API - list, read, modify, and write notebooks back to Databricks workspace
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Work with Databricks notebooks using the REST API - list, read, modify, and write notebooks back to Databricks workspace
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
End-to-end run-image classification with Gemini, including image fetch, prompt control, and JSON output. Use when you need parking or pull-over labels from a run_id.
Find a Gen2 MCAP from a run (or model-derived run), list topics, and extract topic/field values at a specific log time. Use when debugging run-level protobuf signals such as controller_state.
Fetch Buildkite job logs and extract failure lines for debugging CI jobs. Use when a user provides build/job ids or requests failure signal from Buildkite.
Use when forming Spark/SQL queries for Databricks parking evaluation - provides table schemas, PySpark patterns, joins, and filter patterns for PUDO/UNPUDO analysis
Inspect Flyte execution status and per-node/per-task log URIs from a Flyte Console execution URL. Use when a user asks for workflow status, step status, or logs for flyte.data.wayve.ai/dev executions.
Shared Model Catalogue primitives (resolve model refs, find latest checkpoint, call API helpers) used by model lookup/summary/checkpoint/modelci skills. Use when model references must be normalized before downstream analysis.
| name | databricks-notebooks |
| description | Work with Databricks notebooks using the REST API - list, read, modify, and write notebooks back to Databricks workspace |
This skill enables working with Databricks notebooks using the Databricks Workspace REST API. You can list, read, modify, and write notebooks without needing the databricks-cli package or any Python dependencies - just curl and the REST API.
User must have ~/.databrickscfg configured with workspace credentials:
[DEFAULT]
host = https://workspace-url.cloud.databricks.net/
token = dapi...
Always read credentials from the config file:
DATABRICKS_HOST=$(grep "^host" ~/.databrickscfg | cut -d= -f2 | tr -d ' ')
DATABRICKS_TOKEN=$(grep "^token" ~/.databrickscfg | cut -d= -f2 | tr -d ' ')
curl -s -X GET \
"${DATABRICKS_HOST}/api/2.0/workspace/list" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"path": "/Users/username@company.com"}' | jq '.'
Returns objects with:
object_type: NOTEBOOK, DIRECTORY, REPO, LIBRARYpath: Full path to the objectlanguage: PYTHON, SQL, SCALA, R (for notebooks)Download notebook source code to local file:
curl -s -X GET \
"${DATABRICKS_HOST}/api/2.0/workspace/export" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"path": "/Users/username@company.com/notebook_name", "format": "SOURCE"}' \
| jq -r '.content' | base64 -d > /tmp/notebook.py
Important:
"format": "SOURCE" for .py format"format": "JUPYTER" for .ipynb formatUpload modified notebook back to Databricks:
content=$(base64 -w 0 /tmp/notebook.py)
curl -s -X POST \
"${DATABRICKS_HOST}/api/2.0/workspace/import" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"path\": \"/Users/username@company.com/notebook_name\", \"content\": \"$content\", \"format\": \"SOURCE\", \"language\": \"PYTHON\", \"overwrite\": true}"
Important:
"overwrite": true to update existing notebooks{"object_id": ...} on success~/.databrickscfg/tmp/notebook.pyDatabricks notebooks use special comment markers:
# Databricks notebook source
# First cell code here
# COMMAND ----------
# Second cell code here
# COMMAND ----------
# Third cell code here
Each # COMMAND ---------- separates cells.
# Before:
df.filter(condition).display()
# After:
df.filter(condition).limit(10).display()
# Before:
df = spark.table("table_name")
# After:
df = spark.table("table_name").filter(F.col("timestamp") > "2024-01-01")
# Before:
display(df)
# After:
df.show(10, truncate=False)
~/.databrickscfg exists/tmp/ when working with them locallyjq for pretty-printing JSON responses/Users/ or /Shared/