Upgrading to 0.19.0
Resources
Breaking changes
For dbt users
Please be aware of the following changes in v0.19.0:
- dbt artifacts have a new schema. From here on, artifact schemas are officially versioned at schemas.getdbt.com. Future breaking changes will be limited to minor version releases. Some dbt classes, such as the
Result
object, have associated breaking changes. - Defer, a beta feature introduced in v0.18.0, has subtly changed to better support the "Slim CI" use case.
- The
call statement
block returns a structuredresponse
instead of astatus
string, though they print identically. If you previously accessedstatement['status']
within a custom macro or materalization, you should now usestatement['response']
.
See the docs below for more details. We don't expect these to require action in most projects.
Deprecations
Removed support for config-version: 1
of dbt_project.yml, which was deprecated in v0.17.0. Use config-version: 2
in all projects and installed packages. Otherwise, dbt will raise an error. See docs on config-version and the v0.17.0 Migration Guide for details.
For dbt plugin maintainers
(You know who you are!)
Related to change #3 above: The results
context and run_results.json
artifact include a new unstructured dictionary called adapter_response
. This reflects structured information returned by the database after dbt runs the "main" query for a model, seed, snapshot, etc.
By default, this dict accepts keys such as code
(OK
, SUCCESS
, CREATE TABLE
, etc) and rows_affected
(integer). You can add custom arguments to reflect information specific to your adapter. For instance, dbt-bigquery
populates an additional argument, bytes_processed
.
As part of this change:
- the
SQLConnectionManager
methodget_status
has been renamed toget_response
execute
now returns a tuple instead of a string
See dbt#2961 for full implementation details. While adapter_response
is not yet populated by tests or source freshness checks, we hope to add those in a future release (dbt#2964).
New and changed documentation
Core
- dbt Artifacts: The JSON artifacts produced by dbt—manifest, catalog, run results, and sources—are simpler to consume and more clearly documented.
- dbt Classes, on-run-end Context: The
Result
object has a new schema, in line with changes torun_results.json
. - Statement blocks: The
call statement
resultstatus
string is now a structured object namedresponse
. - Snapshots: If the config
invalidate_hard_deletes
is enabled,dbt snapshot
will update records whose unique key no longer exist in the snapshot query. Should those uniquely identified records "revive,"dbt snapshot
will re-add them. - YAML selectors support a
description
property and record their expanded dictionary representations in the manifest. - Modules: The regex python module,
re
, is available in dbt's Jinja context. - parse: New command to parse a dbt project and write detailed timing info.
State
- About state: New docs outlining the conceptual background of state-informed runs, as well as the known caveats for state comparison. In v0.19.0, dbt is a little bit smarter at identifying
state:modified
"false positives" that previously resulted from env-based configurations indbt_project
. - Defer has changed: Instead of deferring all unselected node references, dbt now defers an unselected node reference if and only if it does not exist in the current environment. Tests can defer their upstream references as well. This better supports the "Slim CI" use case by addressing the current environment's resources across
seed
,run
, andtest
steps. - RPC: Added
state
anddefer
as arguments to RPC methods for which it is supported on the CLI.
BigQuery
- BigQuery profile: dbt can connect via OAuth tokens (one-time or refresh), and it can use the default project when connecting via
gcloud
oauth. - Hourly, monthly and yearly partitions: With a new
granularity
attribute of thepartition_by
config, dbt can materialize models as tables partitioned by hour, month, or year.
Spark
- Spark profile: The
thrift
andhttp
connection methods require installation of aPyHive
extra.