Skip to content

Commit

Permalink
Updates to env var names (#3134)
Browse files Browse the repository at this point in the history
## What are you changing in this pull request and why?

Updates docs to inform users of env var name changes for 1.5

## Checklist
<!--
Uncomment if you're publishing docs for a prerelease version of dbt
(delete if not applicable):
- [ ] Add versioning components, as described in [Versioning
Docs](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-entire-pages)
- [ ] Add a note to the prerelease version [Migration
Guide](https://github.com/dbt-labs/docs.getdbt.com/tree/current/website/docs/guides/migration/versions)
-->
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
and [About
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
so my content adheres to these guidelines.
- [x] Add a checklist item for anything that needs to happen before this
PR is merged, such as "needs technical review" or "change base branch."
  • Loading branch information
matthewshaver authored Apr 6, 2023
2 parents b0c5375 + 4930dcd commit fc1e7c2
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 0 deletions.
17 changes: 17 additions & 0 deletions website/docs/docs/deploy/about-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,26 @@ Together, these two features enable ["slim CI"](best-practices#run-only-modified

State and defer can be set by environment variables as well as CLI flags:

<VersionBlock lastVersion="1.4">

- `--state` or `DBT_ARTIFACT_STATE_PATH`: file path
- `--defer` or `DBT_DEFER_TO_STATE`: boolean

</VersionBlock>

<VersionBlock firstVersion="1.5">

- `--state` or `DBT_STATE`: file path
- `--defer` or `DBT_DEFER`: boolean

:::warning Syntax deprecated

In dbt v1.5, we deprecated the original syntax for state (`DBT_ARTIFACT_STATE_PATH`) and defer (`DBT_DEFER_TO_STATE`). Although dbt supports backward compatibility with the old syntax, we will remove it in a future release that we have not yet determined.

:::

</VersionBlock>

If both the flag and env var are provided, the flag takes precedence.

#### Notes:
Expand Down
11 changes: 11 additions & 0 deletions website/docs/guides/migration/versions/02-upgrading-to-v1.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ The manifest schema version will be updated to `v9`. Specific changes:
- Addition of `access` as a top-level node config for models
- Addition of `group` and `contract` as node configs

### For users of env vars

The following env vars have been renamed:

- `DBT_DEFER_TO_STATE``DBT_DEFER`
- `DBT_FAVOR_STATE_MODE``DBT_FAVOR_STATE`
- `DBT_NO_PRINT``DBT_PRINT`
- `DBT_ARTIFACT_STATE_PATH``DBT_STATE`

Backward compatibility with the old syntax is still supported but will be removed in an as-of-yet-undetermined future released.

### For maintainers of adapter plugins

For more detailed information and to ask any questions, please visit [dbt-core/discussions/6624](https://github.com/dbt-labs/dbt-core/discussions/6624).
Expand Down
25 changes: 25 additions & 0 deletions website/docs/reference/global-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ $ dbt --quiet run

### Suppress `print()` messages in stdout

<VersionBlock lastVersion="1.4">

By default, dbt includes `print()` messages in standard out (stdout). You can use the `NO_PRINT` config to prevent these messages from showing up in stdout.

<File name='profiles.yml'>
Expand All @@ -367,6 +369,29 @@ config:

</File>

</VersionBlock>

<VersionBlock firstVersion="1.5">

By default, dbt includes `print()` messages in standard out (stdout). You can use the `PRINT` config to prevent these messages from showing up in stdout.

<File name='profiles.yml'>

```yaml
config:
print: false
```

</File>

:::warning Syntax deprecation

The original `NO_PRINT` syntax has been deprecated, starting with dbt v1.5. Backward compatibility is supported but will be removed in an as-of-yet-undetermined future release.

:::

</VersionBlock>

Supply `--no-print` flag to `dbt run` to suppress `print()` messages from showing in stdout.

```text
Expand Down
10 changes: 10 additions & 0 deletions website/docs/reference/node-selection/defer.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,18 @@ When using defer, you may be selecting from production datasets, development dat
- if you apply env-specific limits in dev but not prod, as you may end up selecting more data than you expect
- when executing tests that depend on multiple parents (e.g. `relationships`), since you're testing "across" environments

<VersionBlock lastVersion="1.4">

Deferral requires both `--defer` and `--state` to be set, either by passing flags explicitly or by setting environment variables (`DBT_DEFER_TO_STATE` and `DBT_ARTIFACT_STATE_PATH`). If you use dbt Cloud, read about [how to set up CI jobs](/docs/deploy/cloud-ci-job).

</VersionBlock>

<VersionBlock firstVersion="1.5">

Deferral requires both `--defer` and `--state` to be set, either by passing flags explicitly or by setting environment variables (`DBT_DEFER` and `DBT_STATE`). If you use dbt Cloud, read about [how to set up CI jobs](/docs/deploy/cloud-ci-job).

</VersionBlock>

<VersionBlock firstVersion="1.4">

#### Favor state
Expand Down
26 changes: 26 additions & 0 deletions website/docs/reference/node-selection/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,18 @@ that defines it. For more information about how generic tests are defined, read

**N.B.** State-based selection is a powerful, complex feature. Read about [known caveats and limitations](node-selection/state-comparison-caveats) to state comparison.

<VersionBlock lastVersion="1.4">

The `state` method is used to select nodes by comparing them against a previous version of the same project, which is represented by a [manifest](artifacts/manifest-json). The file path of the comparison manifest _must_ be specified via the `--state` flag or `DBT_ARTIFACT_STATE_PATH` environment variable.

</VersionBlock>

<VersionBlock firstVersion="1.5">

The `state` method is used to select nodes by comparing them against a previous version of the same project, which is represented by a [manifest](artifacts/manifest-json). The file path of the comparison manifest _must_ be specified via the `--state` flag or `DBT_STATE` environment variable.

</VersionBlock>

`state:new`: There is no node with the same `unique_id` in the comparison manifest

`state:modified`: All new nodes, plus any changes to existing nodes.
Expand Down Expand Up @@ -222,11 +232,27 @@ The following dbt commands produce `sources.json` artifacts whose results can be

After issuing one of the above commands, you can reference the source freshness results by adding a selector to a subsequent command as follows:

<VersionBlock lastVersion="1.4">

```bash
# You can also set the DBT_ARTIFACT_STATE_PATH environment variable instead of the --state flag.
$ dbt source freshness # must be run again to compare current to previous state
$ dbt build --select source_status:fresher+ --state path/to/prod/artifacts
```

</VersionBlock>

<VersionBlock firstVersion="1.5">

```bash
# You can also set the DBT_STATE environment variable instead of the --state flag.
$ dbt source freshness # must be run again to compare current to previous state
$ dbt build --select source_status:fresher+ --state path/to/prod/artifacts
```

</VersionBlock>


</VersionBlock>


Expand Down

0 comments on commit fc1e7c2

Please sign in to comment.