Metadata-Version: 2.4
Name: vibedata-dbt-fabric-notebook
Version: 0.1.0
Summary: VibeData dbt runtime — Fabric notebook execution unit: clone the domain repo (Key Vault m2m PAT) and run a list of dbt commands on the official dbt-fabricspark adapter, persisting run_results/manifest to the lakehouse. notebookutils is provided by the Fabric runtime; dbt + dbt-fabricspark are pip-installed by the notebook.
Author-email: Vibedata <eng@acceleratedata.ai>
License: MIT
Requires-Python: >=3.11
Provides-Extra: dev
Requires-Dist: pytest-mock>=3.12; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# vibedata-dbt-fabric-notebook

Fabric **notebook execution unit for dbt** — the dbt counterpart of
`vibedata-dlt-fabric-notebook`. Clones the domain repo and runs a list of dbt
commands on the official
[`dbt-fabricspark`](https://github.com/microsoft/dbt-fabricspark) adapter
(Livy/Spark), persisting `run_results.json` + `manifest.json` + `dbt.log` to the
lakehouse (the dbt audit the runtime-audit read layer reads — the dbt analog of
dlt's `finalize()`).

## Use inside a Fabric notebook

```python
%pip install vibedata-dbt-fabric-notebook dbt-fabricspark>=1.10 -q

from vibedata.dbt.fabric.notebook import clone_domain_repo, run_dbt_commands

repo = clone_domain_repo(REPO_URL, vault_url=VAULT_URL, branch=BRANCH)   # KV m2m PAT
run_dbt_commands(
    ["dbt deps", "dbt build --select +fct_orders --target prod"],
    project_dir=f"{repo}/transformation",
)
```

- **Auth:** the domain repo is cloned with the m2m GitHub secret
  (`domain-github-pat-token`) read from Key Vault via `notebookutils` — the same
  slot the dlt runner uses. **No OneLake deploy key.**
- **Command list:** dbt Core has no "run a list" concept; `run_dbt_commands` is a
  thin fail-fast loop. Put `dbt deps` in the list if you need it — the runner
  never runs it implicitly.
- **Zero pip deps of its own:** `notebookutils` is provided by the Fabric
  runtime; `dbt` + `dbt-fabricspark` are installed by the notebook cell.

## Follow-up

`clone_domain_repo` here duplicates the dlt runner's clone. They should fold into
one shared, dlt-free `*-notebook-core` helper — deferred to avoid a refactor of
the working dlt packages (`fabric-core` currently pulls `dlt`, so it isn't a
clean shared home). Tracked as a follow-up.
