Skip to content

Commit

Permalink
Deprecated environment variables for state and defer (#6784)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 authored Jan 17, 2025
2 parents 21128eb + 7fa1294 commit 1680a0c
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions website/docs/reference/node-selection/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,6 @@ Together, the [`state`](/reference/node-selection/methods#state) selector and de

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

- `--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.

:::

- `--state` or `DBT_STATE`: file path
- `--defer` or `DBT_DEFER`: boolean
- `--defer-state` or `DBT_DEFER_STATE`: file path to use for deferral only (optional)
Expand All @@ -157,6 +148,12 @@ If both the flag and env var are provided, the flag takes precedence.
- The `--state` artifacts must be of schema versions that are compatible with the currently running dbt version.
- These are powerful, complex features. Read about [known caveats and limitations](/reference/node-selection/state-comparison-caveats) to state comparison.

:::warning Syntax deprecated

In [dbt v1.5](/docs/dbt-versions/core-upgrade/upgrading-to-v1.5#behavior-changes), 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.

:::

### The "result" status

Another element of job state is the `result` of a prior dbt invocation. After executing a `dbt run`, for example, dbt creates the `run_results.json` artifact which contains execution times and success / error status for dbt models. You can read more about `run_results.json` on the ['run results'](/reference/artifacts/run-results-json) page.
Expand Down Expand Up @@ -204,7 +201,7 @@ When a job is selected, dbt Cloud will surface the artifacts from that job's mos
After issuing the `dbt source freshness` command, you can reference the source freshness results by adding a selector to a subsequent command:

```bash
# You can also set the DBT_ARTIFACT_STATE_PATH environment variable instead of the --state flag.
# 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
```
Expand Down

0 comments on commit 1680a0c

Please sign in to comment.