Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions ibis_typing/dbt/README.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Loading