Skip to content

Commit

Permalink
Merge branch 'current' into dbeatty10-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 authored Mar 15, 2024
2 parents c141981 + 5d7625d commit 4b9ebd7
Show file tree
Hide file tree
Showing 18 changed files with 486 additions and 170 deletions.
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/b-propose-new-content.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Propose new content"
description: "For proposing new content, such as a new guide or a new page."
title: "[idea] <title>"
labels: ["content","idea"]
body:
- type: markdown
attributes:
value: |
Thank you for sharing your idea for the dbt product documentation! Here are a few things to consider:
* You can submit ideas or suggest changes to our content by opening an [Issue](https://github.com/dbt-labs/docs.getdbt.com/issues/new/choose).
* Before filing an issue, please [search our current issues](https://github.com/dbt-labs/docs.getdbt.com/issues) to avoid duplicates.
* Please read the [Contributing guide](https://github.com/dbt-labs/docs.getdbt.com#contributing) if you want to open a pull request.
- type: checkboxes
id: author_type
attributes:
label: "Which of these best describes you?"
options:
- label: "dbt Community member"
- label: "Partner"
- label: "dbt Labs employee"
- label: "Other"
validations:
required: false

- type: textarea
id: content_idea
attributes:
label: "What's your idea for new content?"
description: |
- Give as much detail as you can to help us understand your idea.
- Why do you think this content is important?
- Who will this new content help?
validations:
required: true

- type: textarea
id: location
attributes:
label: Where would you recommend this content live on the docs.getdbt.com?
description: "Please link to the page or pages you think best fit."
validations:
required: false
54 changes: 0 additions & 54 deletions .github/ISSUE_TEMPLATE/contribute-to-developer-blog.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/external-core-team.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: dbt Core - Request changes to docs
description: File a docs update request that is not already tracked in Orch team's Release Plans (Notion database).
description: "File a docs update or feature request related to dbt Core content."
title: "[Core] <title>"
labels: ["content","dbt Core"]
body:
Expand Down
32 changes: 32 additions & 0 deletions website/docs/docs/build/data-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ keywords:
* [Data test configurations](/reference/data-test-configs)
* [Test selection examples](/reference/node-selection/test-selection-examples)

<VersionBlock firstVersion="1.8">

:::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 syntax](#new-tests-syntax) for more information.

:::

</VersionBlock>

## Overview

Data tests are assertions you make about your models and other resources in your dbt project (e.g. sources, seeds and snapshots). When you run `dbt test`, dbt will tell you if each test in your project passes or fails.
Expand Down Expand Up @@ -251,6 +261,28 @@ Note that, if you select to store test failures:
* Test result tables are created in a schema suffixed or named `dbt_test__audit`, by default. It is possible to change this value by setting a `schema` config. (For more details on schema naming, see [using custom schemas](/docs/build/custom-schemas).)
- A test's results will always **replace** previous failures for the same test.

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

## New `data_tests:` syntax

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 file as an alias but will be deprecated in the future in favor of `data_tests:`.

As we progress towards this deprecation, the examples in our docs pages will be updated 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.

```yml
models:
- name: orders
columns:
- name: order_id
data_tests:
- unique
- not_null
```
</VersionBlock>

## FAQs

<FAQ path="Tests/test-one-model" />
Expand Down
89 changes: 77 additions & 12 deletions website/docs/docs/build/saved-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,33 @@ Saved queries are distinct from [exports](/docs/use-dbt-semantic-layer/exports),

All metrics in a saved query need to use the same dimensions in the `group_by` or `where` clauses. The following is an example of a saved query:

<!-- For versions 1.8 and higher -->
<VersionBlock firstVersion="1.8">

<File name='semantic_model.yml'>

```yaml
saved_queries:
- name: p0_booking
description: Booking-related metrics that are of the highest priority.
- name: test_saved_query
description: "{{ doc('saved_query_description') }}"
label: Test saved query
config:
cache:
enabled: true # Or false if you want it disabled by default
query_params:
metrics:
- bookings
- instant_bookings
group_by:
- TimeDimension('metric_time', 'day')
- Dimension('listing__capacity_latest')
where:
- "{{ Dimension('listing__capacity_latest') }} > 3"
metrics:
- simple_metric
group_by:
- "Dimension('user__ds')"
where:
- "{{ Dimension('user__ds', 'DAY') }} <= now()"
- "{{ Dimension('user__ds', 'DAY') }} >= '2023-01-01'"
exports:
- name: my_export
config:
alias: my_export_alias
export_as: table
schema: my_export_schema_name
```
</File>
Expand All @@ -48,6 +60,9 @@ To define a saved query, refer to the following parameters:
|-------|---------|----------|----------------|
| `name` | String | Required | Name of the saved query object. |
| `description` | String | Required | A description of the saved query. |
| `label` | String | Required | The display name for your saved query. This value will be shown in downstream tools. |
| `config` | String | Required | A config section for any parameters specifying the saved query. |
| `config::cache` | String | Optional | A boolean to specify if a saved query should be used to populate the cache. Accepts `true` or `false`. Defaults to `false` |
| `query_params` | Structure | Required | Contains the query parameters. |
| `query_params::metrics` | List or String | Optional | A list of the metrics to be used in the query as specified in the command line interface. |
| `query_params::group_by` | List or String | Optional | A list of the Entities and Dimensions to be used in the query, which include the `Dimension` or `TimeDimension`. |
Expand All @@ -57,10 +72,60 @@ To define a saved query, refer to the following parameters:
| `exports::config` | List or Structure | Required | A config section for any parameters specifying the export. |
| `exports::config::export_as` | String | Required | The type of export to run. Options include table or view currently and cache in the near future. |
| `exports::config::schema` | String | Optional | The schema for creating the table or view. This option cannot be used for caching. |
| `exports::config::alias` | String | Optional | The table alias to use to write the table or view. This option cannot be used for caching. |
| `exports::config::alias` | String | Optional | The table alias used to write to the table or view. This option cannot be used for caching. |

All metrics in a saved query need to use the same dimensions in the `group_by` or `where` clauses.
</VersionBlock>

<!-- For versions 1.7 and lower-->
<VersionBlock lastVersion="1.7">

<File name='semantic_model.yml'>

```yaml
saved_queries:
- name: test_saved_query
description: "{{ doc('saved_query_description') }}"
label: Test saved query
query_params:
metrics:
- simple_metric
group_by:
- "Dimension('user__ds')"
where:
- "{{ Dimension('user__ds', 'DAY') }} <= now()"
- "{{ Dimension('user__ds', 'DAY') }} >= '2023-01-01'"
exports:
- name: my_export
config:
alias: my_export_alias
export_as: table
schema: my_export_schema_name
```
</File>

## Parameters

To define a saved query, refer to the following parameters:

| Parameter | Type | Required | Description |
|-------|---------|----------|----------------|
| `name` | String | Required | Name of the saved query object. |
| `description` | String | Required | A description of the saved query. |
| `label` | String | Required | The display name for your saved query. This value will be shown in downstream tools. |
| `query_params` | Structure | Required | Contains the query parameters. |
| `query_params::metrics` | List or String | Optional | A list of the metrics to be used in the query as specified in the command line interface. |
| `query_params::group_by` | List or String | Optional | A list of the Entities and Dimensions to be used in the query, which include the `Dimension` or `TimeDimension`. |
| `query_params::where` | List or String | Optional | A list of strings that may include the `Dimension` or `TimeDimension` objects. |
| `exports` | List or Structure | Optional | A list of exports to be specified within the exports structure. |
| `exports::name` | String | Required | Name of the export object. |
| `exports::config` | List or Structure | Required | A config section for any parameters specifying the export. |
| `exports::config::export_as` | String | Required | The type of export to run. Options include table or view currently and cache in the near future. |
| `exports::config::schema` | String | Optional | The schema for creating the table or view. This option cannot be used for caching. |
| `exports::config::alias` | String | Optional | The table alias used to write to the table or view. This option cannot be used for caching. |

</VersionBlock>

All metrics in a saved query need to use the same dimensions in the `group_by` or `where` clauses.

## Related docs

Expand Down
6 changes: 4 additions & 2 deletions website/docs/docs/core/about-core-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ dbt Core is an [open-source](https://github.com/dbt-labs/dbt-core) tool that ena
- [Connecting to a data platform](/docs/core/connect-data-platform/profiles.yml)
- [How to run your dbt projects](/docs/running-a-dbt-project/run-your-dbt-projects)

To learn about developing dbt projects in dbt Cloud, refer to [Develop with dbt Cloud](/docs/cloud/about-develop-dbt).
- dbt Cloud provides a command line interface with the [dbt Cloud CLI](/docs/cloud/cloud-cli-installation). Both dbt Core and the dbt Cloud CLI are command line tools that let you run dbt commands. The key distinction is the dbt Cloud CLI is tailored for dbt Cloud's infrastructure and integrates with all its [features](/docs/cloud/about-cloud/dbt-cloud-features).
If you're interested in using a command line interface to [develop dbt projects in dbt Cloud](/docs/cloud/about-develop-dbt), the [dbt Cloud CLI](/docs/cloud/cloud-cli-installation) lets you run dbt commands locally. The dbt Cloud CLI is tailored for dbt Cloud's infrastructure and integrates with all its [features](/docs/cloud/about-cloud/dbt-cloud-features).

If you need a more detailed first-time setup guide for specific data platforms, read our [quickstart guides](https://docs.getdbt.com/guides).

## Related docs
- [Move from dbt Core to dbt Cloud](/guides/core-to-cloud-1?step=1)
3 changes: 3 additions & 0 deletions website/docs/docs/core/installation-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ Most command-line tools, including dbt, have a `--help` flag that you can use to
&mdash; `dbt run --help`: Lists the flags available for the `run` command

:::

## Related docs
- [Move from dbt Core to dbt Cloud](/guides/core-to-cloud-1?step=1)
2 changes: 1 addition & 1 deletion website/docs/docs/deploy/deploy-jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Here are examples of cron job schedules. The dbt Cloud job scheduler supports us
- `0 7 L * 5`: At 07:00 AM, on the last day of the month, and on Friday.
- `30 14 L * *`: At 02:30 PM, on the last day of the month.

### Trigger on job completion <Lifecycle status="team,enterprise" />
### Trigger on job completion <Lifecycle status="team,enterprise" />

To _chain_ deploy jobs together, enable the **Run when another job finishes** option and specify the upstream (parent) job that, when it completes, will trigger your job. You can also use the [Create Job API](/dbt-cloud/api-v2#/operations/Create%20Job) to do this.

Expand Down
Loading

0 comments on commit 4b9ebd7

Please sign in to comment.