Upgrading to v0.21
Unsupported version
dbt Core v0.21 has reached the end of critical support. No new patch versions will be released, and it will stop running in dbt Cloud on June 30, 2022. Read "About dbt Core versions" for more details.
Resources
Breaking changes
dbt source snapshot-freshness
has been renamed todbt source freshness
. Its node selection logic is now consistent with other tasks. In order to check freshness for a specific source, you must prefix it withsource:
.- Snowflake: Turn off transactions and turn on
autocommit
by default. Within dbt materializations, wrap DML statements in explicitbegin
andcommit
. Note that it is not recommended to run DML statements outside of dbt materialization logic. If you do this, despite our recommendation, you will need to wrap those statements in explicitbegin
andcommit
. Note also that this may affect user-space code that depends on transactions, such as pre-hooks and post-hooks that specifytransaction: true
ortransaction: false
. We recommend removing those references to transactions. - Artifacts:
manifest.json
uses av3
schema that includes additional node properties (no changes to existing properties)run_results.json
uses av3
schema that has addedskipped
as a potentialTestResult
sources.json
has a newv2
schema that has added timing and thread details
New and changed documentation
Tasks
- Commands,
build
, rpc: Adddbt build
- Commands:
source
: Renamed todbt source freshness
. deps
: Adddbt deps
logging for outdated packageslist
: Add--output-keys
flag and RPC parameter
Selection
- Commands:
source
: Updated selection logic to match other tasks. When selecting a specific source to check freshness, you must prefix it withsource:
. - Node selection syntax, commands: Switch
--models
for--select
across the board. (Commands which previously used the--models
flag still support it for backwards compatibility.) - YAML selectors now support an optional
default
property. If set, dbt will use custom selection criteria for commands that do not specify their own selection/exclusion flags. - Selection methods and state comparison caveats: Add
state:modified
subselectors, and reflect that it now includes changes to upstream macros. - Test selection examples includes more discussion of indirect selection (a change in v0.20), and the optional "greedy" flag/property (new in v0.21), which you can optionally set to include tests that have a mix of selected + unselected parents
Elsewhere in Core
- Resource configs and properties docs have been consolidated and reconciled. New
config
property that makes it possible to configure models, seeds, snapshots, and tests in all YAML files. - Configuring incremental models: New optional configuration for incremental models,
on_schema_change
. - Environment variables: Add a log-scrubbing prefix,
DBT_ENV_SECRET_
- Test
where
config has been reimplemented as a macro (get_where_subquery
) that you can optionally reimplement, too dispatch
now supports reimplementing global macros residing in thedbt
macro namespace with versions from installed packages, by leveragingsearch_order
in thedispatch
project config
Plugins
- Postgres profile property
connect_timeout
now configurable. Also applicable to child plugins (e.g.dbt-redshift
) - Redshift: profile property
ra3_node: true
to support cross-database source definitions and read-only querying - BigQuery: profile property
execution_project
now configurable. Snapshots supporttarget_project
andtarget_dataset
config aliases.
0