In a workspace
Use these steps when you have a Databricks workspace. The paths are the same demos and opt-in harnesses already in the repository — ordered for operators.
Shared setup
Clone or sync the repo into the workspace (Git folder or
databricks workspace import-dir).Build a wheel and upload it where the notebooks can install it:
uv build # example destinations used by the demos: # dbfs:/FileStore/tablespec-demo/ or a UC volume pathPrefer a single-user cluster on a recent LTS runtime (Python ≥ 3.12 for current wheels; DBR 16.4+ is a good default).
1. Bootstrap existing tables (Path A)
When tables already live in Unity Catalog / Spark:
from tablespec import bootstrap_from_tables
artifacts = bootstrap_from_tables(
spark,
["catalog.schema.member", "catalog.schema.claims"],
out_dir="/tmp/tablespec-bootstrap",
profile=True,
dialect="databricks", # Spark-family SQL; accepted public dialect
)bootstrap_from_tables reflects schema into UMF, optionally enriches validation
from the native profiler, compiles the committed artifact tree, and returns the
manifest. See also Getting Started for Path B (authored
specs) without Spark.
2. Northwind — JDBC discovery end to end
Goal: point tablespec at a SQL Server database; get one validated UMF per table, Excel workbooks, sample data, typed land, staged validation.
Notebooks:
notebooks/northwind-demo/
| Order | Notebook | Role |
|---|---|---|
| 1 | 01-provision-sqlserver-northwind | Installs SQL Server on the driver and loads Northwind (plumbing — not a tablespec product path) |
| 2 | 02-northwind-discovery-demo | Discover → validate → workbooks → sample data → land typed → scorecard |
Requirements: single-node cluster so localhost JDBC works; single-user
access mode. Credentials in UMF are secret refs only.
Local stand-in (no workspace): Docker-gated
uv run pytest tests/integration/test_northwind_e2e.py.
3. Kaggle-style flat file — delimited onboarding
Goal: stage a CSV on a UC volume, land all-STRING raw, profile, author UMF, export a workbook, compile artifacts, run staged validation.
Notebooks:
notebooks/kaggle-demo/
| Order | Notebook | Role |
|---|---|---|
| 1 | 01-stage-csv-kaggle | Create schema/volume; stage CSV (plumbing) |
| 2 | 02-kaggle-tablespec-demo | tablespec story end to end |
Default dataset is NYC Airbnb open data; widgets swap URL/path for other CSVs.
4. SEC 10-K — embeddings and JSON facts
Goal: govern a corpus table with EMBEDDING(1024) and an XBRL facts table
via source: kind: json, with dimensionality validation on the embedding
column.
Notebooks:
notebooks/sec-10k-demo/
| Order | Notebook | Role |
|---|---|---|
| 1 | 01-edgar-plumbing | EDGAR fetch, chunk, embed (real FM API or deterministic fake), land JSON |
| 2 | 02-sec10k-tablespec-demo | Validate specs, compile artifacts, staged validation scorecard |
Use embedding_mode=fake when the workspace has no Foundation Model API
access. Specs never embed endpoints or credentials.
Example specs:
examples/sec10k_corpus.yaml,
examples/sec10k_companyfacts.yaml.
5. Opt-in serverless / workspace conformance
Goal: when credentials are present, prove dbt/LDP deploy + read-back parity against the shared Spark oracle corpus.
Default make test never requires a workspace. The lane is opt-in:
export DATABRICKS_HOST=https://<workspace>
export DATABRICKS_HTTP_PATH=/sql/1.0/warehouses/<id>
export DATABRICKS_TOKEN=<pat>
# adapters: dbt-databricks, databricks-sdk, databricks-sql-connector
uv run pytest -m databricks_e2e -qWithout credentials, those tests skip with a named reason — they do not
silently pass. The unit gate for the skip path is
tests/unit/test_databricks_e2e_gate.py.
6. Deploy the profiling app
Separate checklist: Deploy the app.
Checkpoints
| Path | Success looks like |
|---|---|
| Path A bootstrap | Artifact tree under out_dir; recompile is a no-diff for unchanged UMF |
| Northwind | Scorecard finishes; every discovered table has a validated UMF |
| Kaggle | Staged validation report for the landed table |
| SEC 10-K | Dimensionality checks run on the corpus embedding column |
| Serverless e2e | pytest -m databricks_e2e green with workspace credentials (skips cleanly without them) |
| App | Guidebook/profile tabs use only the declared metadata home |