From e6215fa957aa1360f7ce596eaee16fd6f85f047c Mon Sep 17 00:00:00 2001 From: Ivar Olofsson Date: Tue, 30 Jun 2026 13:16:39 +0200 Subject: [PATCH] docs(dbt): Add notes on DBT --- README.md | 6 ++++++ ibis_typing/dbt/README.md | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 732ef99..cac0aa7 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,12 @@ analysis, and property-based testing. BigQuery, and more. **ibis-typing** layers a type-safe schema system on top of it, so your transforms carry type information end-to-end. +[DBT](https://docs.getdbt.com/) is a popular SQL transformation framework. [**ibis-typing.dbt +**](ibis_typing/dbt/README.md) can compile typed Ibis Expressions +to DBT SQL for execution in your warehouse, +combining the ubiquity of DBT +with the expressiveness and benefits of a high-level typed DSL. + ## Installation ```bash diff --git a/ibis_typing/dbt/README.md b/ibis_typing/dbt/README.md index 9f748c9..48d2642 100644 --- a/ibis_typing/dbt/README.md +++ b/ibis_typing/dbt/README.md @@ -1,4 +1,4 @@ -# `ibis_typing.dbt` — dbt Integration +# `ibis_typing.dbt` — DBT Integration Bridges typed `ibis_typing` [Expression](../expression.py) classes with [DBT](https://docs.getdbt.com/) by compiling them to DBT SQL (Jinja templates). @@ -52,7 +52,7 @@ def get_dbt_model_lookup() -> Mapping[type[Expression], DbtModel]: resolver = dbt_model_resolver.DbtModelResolver(samples) models = { - # Provide timestamp as a table so every dbt run uses a fixed timestamp. + # Provide timestamp as a table so every DBT run uses a fixed timestamp. DbtModel( TimestampNow, config=ModelConfig( @@ -100,7 +100,7 @@ def as_db_schema(schema: type[IbisSchema]) -> type[IbisDbSchema]: --- -## Compiling to dbt SQL +## Compiling to DBT SQL Use `DbtRefTableProvider` to wire the model and source lookups together, then call `dbt_model_to_dbt_sql` for each model. @@ -135,5 +135,7 @@ The compiler automatically: ## Auto-Discovery with `DbtModelResolver` -`DbtModelResolver` scans a Python package and returns all `Expression` -subclasses grouped by category: +`DbtModelResolver` scans a Python package +and returns all `Expression` subclasses grouped by category +like Incremental, Snapshot, and other models. +Use it to hook your ibis Expression transform into the DBT toolchain.