Skip to main content

dbt-polars

dbt-polars integrates the flexibility and performance of Polars with the data governance and lineage capabilities of dbt.

Try the quick start and run your first dbt-polars project in a few minutes, on your own laptop.

Python and SQL, side by side

Choose Python or SQL per model, whichever fits the transformation best. Both run on the same Polars engine and can freely reference each other. Unlike in dbt-core, Python models are first class and can do anything a SQL model can, even be ephemeral.

Python: models/revenue.py SQL: models/revenue.sql
import polars as pl


def model(dbt, session):
    return (
        dbt.ref("orders")
        .group_by("country")
        .agg(revenue=pl.sum("amount"))
    )
select
    country,
    sum(amount) as revenue
from {{ ref('orders') }}
group by country

The flexibility of Python and Polars

dbt-polars runs on any compute and writes to any of its catalogs

Run anywhere. Polars executes your models in the same process as dbt. You don't need an expensive data warehouse to run your transformations. dbt-polars runs anywhere you can run Python.

Store data where you want. dbt-polars connects to popular platforms through catalogs. Setting one up only takes a few lines in your profile.

Platform Catalog
Local filesystem local
Azure Blob Storage / ADLS Gen2 azure
Databricks Unity Catalog databricks (Delta, Iceberg)
Microsoft Fabric OneLake fabric (Delta, Iceberg)
Snowflake Horizon Catalog snowflake (Iceberg)
Other Iceberg catalogs, such as REST or Glue iceberg

Extensible to any platform. Implement a custom catalog to tailor dbt-polars to your platform. A custom catalog controls authentication, where data is written and how metadata is registered. The dbt-polars engine still performs the writes.

The familiarity of dbt

If you know dbt, you already know how to use dbt-polars. Introduce dbt-polars to your Python projects to benefit from key dbt features, such as lineage, documentation and tests. See dbt compatibility for the full list of supported dbt features.

Lineage graph of a dbt-polars project

Built for efficiency

dbt-polars builds on the full power of the Polars engine. Models run lazily, so Polars optimizes the whole query before running it. Execution and writes are streamed in batches to keep memory use low.

Get started

Install dbt-polars and create a new project:

pip install dbt-polars
dbt init

The quick start walks you through the rest. It runs locally and writes tables to your disk, so you don't need a cloud account. Afterwards, the demo project builds a weather data pipeline that uses many of dbt-polars' features along the way.

Limitations

  • Views are not supported, as there is no database to hold them. Use table or ephemeral instead.
  • The hash macro is not supported. Use a Python model for hashing instead.

Documentation

The full documentation is available at datamindedbe.github.io/dbt-polars.

Metadata

Release files for dbt-polars 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dbt-polars 0.5.2
File Size Uploaded Provenance Actions
dbt_polars-0.5.2.tar.gz 95.9 kB Without provenance Details for dbt_polars-0.5.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dbt-polars 0.5.2
File Interpreter ABI Platform Actions
dbt_polars-0.5.2-py3-none-any.whl Python 3 none any Details for dbt_polars-0.5.2-py3-none-any.whl

Total release size: 219.6 kB

Release files / dbt_polars-0.5.2.tar.gz

Download URL dbt_polars-0.5.2.tar.gz
Size 95.9 kB
Tags Source
SHA-256 checksum
How to use checksums
475e51b27f4b4385c7ee630a93e3d47edb375e43919a3e040b29dae985210ec6
BLAKE2b-256 checksum
How to use checksums
2f137bc828a48c2d7c7aad810084eacc40fd8444480eb8226a60df498d896c7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / dbt_polars-0.5.2-py3-none-any.whl

Download URL dbt_polars-0.5.2-py3-none-any.whl
Size 123.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c41a1498a0112df86d29600972c9bd6ec5f4d25156538e7facc071cc654b14bc
BLAKE2b-256 checksum
How to use checksums
a3ec22a3f269dc9a67aa3abc2b1009333c35b0a3640bb92f136a479e1735e209
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for dbt-polars 0.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page