Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to env var names #3134

Merged
merged 4 commits into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

The original syntax for state (`DBT_ARTIFACT_STATE_PATH`) and defer (`DBT_DEFER_TO_STATE`) have been deprecated in dbt v1.5. Backward compatibility is supported in this version but will be removed in an as-of-yet-undetermined future release.
matthewshaver marked this conversation as resolved.
Show resolved Hide resolved

:::

</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