github dbt-labs/dbt v0.5.0
dbt version 0.5.0

0. tl;dr

  • use a temp table when executing incremental models
  • arbitrary configuration (using config variables)
  • specify branches for dependencies
  • more & better docs

1. new incremental model generation

In previous versions of dbt, an edge case existed which caused the sql_where query to select different rows in the delete and insert steps. As a result, it was possible to construct incremental models which would insert duplicate records into the specified table. With this release, DBT uses a temp table which will 1) circumvent this issue and 2) improve query performance. For more information, check out the GitHub issue:

2. Arbitrary configuration

Configuration in dbt is incredibly powerful: it is what allows models to change their behavior without changing their code. Previously, all configuration was done using built-in parameters, but that actually limits the user in the power of configuration.

With this release, you can inject variables from dbt_project.yml into your top-level and dependency models. In practice, variables work like this:

# dbt_project.yml

      exclude_ip: ''
-- filtered_events.sql

-- source code
select * from where ip_address != '{{ var("exclude_ip") }}'

-- compiles to
select * from where ip_address != ''

The vars parameter in dbt_project.yml is compiled, so you can use jinja templating there as well! The primary use case for this is specifying "input" models to a dependency.

Previously, dependencies used ref(...) to select from a project's base models. That interface was brittle, and the idea that dependency code had unbridled access to all of your top-level models made us a little uneasy. As of this release, we're deprecating the ability for dependencies to ref(...) top-level models. Instead, the recommended way for this to work is with vars! An example:

-- dbt_modules/snowplow/models/events.sql

select * from {{ var('snowplow_events_table') }}


      snowplow_events_table: "{{ ref('base_events') }}"

This effectively mirrors the previous behavior, but it much more explicit about what's happening under the hood!

3. specify a dependency branch

With this release, you can point DBT to a specific branch of a dependency repo. The syntax looks like this:

    - # use the "development" branch

4. More & Better Docs!

Check em out! And let us know if there's anything you think we can improve upon!


To upgrade to version 0.5.0 of dbt, run:

pip install --upgrade dbt
latest releases: v0.21.0b1, v0.20.1rc1, v0.20.0...
4 years ago