Skip to content

Commit

Permalink
Clarify that tests is backwards compatible to data_tests (#5859)
Browse files Browse the repository at this point in the history
## What are you changing in this pull request and why?
In [this Slack
thread](https://getdbt.slack.com/archives/C069A7N46UU/p1722212929868559?thread_ts=1721941881.792499&cid=C069A7N46UU),
someone pointed out to me that we're indicating that backwards
compatibility for `tests` could be removed at some point in the future.

We have no plans to do so, and _even if_ we did decide to do it one day
it would go through the [behaviour change
process](https://docs.getdbt.com/reference/global-configs/legacy-behaviors),
so we don't need to be warning about urgent action or disruption.

## Checklist
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- [x] For [docs
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#about-versioning),
review how to [version a whole
page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
and [version a block of
content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content).

---------

Co-authored-by: Mirna Wong <[email protected]>
Co-authored-by: Leona B. Campbell <[email protected]>
  • Loading branch information
3 people authored Aug 1, 2024
1 parent 83def39 commit f2541aa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions website/docs/docs/build/data-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ keywords:

:::important

In dbt v1.8, what was previously known as "tests" are now called "data tests" with the addition of [unit tests](/docs/build/unit-tests). The YAML key `tests:` is still supported as an alias for data tests but will be deprecated in the future in favor of `data_tests:`. Refer to [New `data_tests:` syntax](#new-data_tests-syntax) for more information.
From dbt v1.8, "tests" are now called "data tests" to disambiguate from [unit tests](/docs/build/unit-tests). The YAML key `tests:` is still supported as an alias for `data_tests:`. Refer to [New `data_tests:` syntax](#new-data_tests-syntax) for more information.

:::

Expand Down Expand Up @@ -275,13 +275,11 @@ In dbt version 1.8, we updated the `tests` configuration to `data_tests`. For de

</VersionBlock>

<VersionBlock firstVersion="1.8" lastVersion="1.8">
<VersionBlock firstVersion="1.8">

Data tests were historically called "tests" in dbt as the only form of testing available. With the introduction of unit tests in v1.8, it was necessary to update our naming conventions and syntax.

As of v1.8, `tests:` is still supported in your YML configuration files as an alias but will be deprecated in the future in favor of `data_tests:`.
Data tests were historically called "tests" in dbt as the only form of testing available. With the introduction of unit tests in v1.8, the key was renamed from `tests:` to `data_tests:`.

As we progress towards this deprecation, we'll update the examples in our docs pages to reflect this new syntax, but we highly recommend you begin the migration process as soon as you upgrade to v1.8 to avoid interruptions or issues in the future.
dbt still supports `tests:` in your YML configuration files for backwards-compatibility purposes, and you might see it used throughout our documentation. However, you can't have a `tests` and a `data_tests` key associated with the same resource (e.g. a single model) at the same time.

<File name='models/schema.yml'>

Expand All @@ -306,6 +304,8 @@ data_tests:

</File>

To suppress warnings about the rename, add `TestsConfigDeprecation` to the `silence` block of the `warn_error_options` flag in `dbt_project.yml`, [as described in the Warnings documentation](https://docs.getdbt.com/reference/global-configs/warnings).

</VersionBlock>

## FAQs
Expand Down

0 comments on commit f2541aa

Please sign in to comment.