Skip to content

Commit

Permalink
Merge branch 'current' into mwong-config-descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewshaver authored Nov 13, 2023
2 parents c26f466 + bd154df commit 72c5d3d
Show file tree
Hide file tree
Showing 16 changed files with 128 additions and 106 deletions.
13 changes: 3 additions & 10 deletions website/docs/docs/build/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ keywords:
tags: [Metrics]
---

:::caution Upgrade to access MetricFlow and the new dbt Semantic Layer
import DeprecationNotice from '/snippets/_sl-deprecation-notice.md';

The dbt_metrics package has been deprecated and replaced with [MetricFlow](/docs/build/about-metricflow?version=1.6). If you're using the dbt_metrics package or the legacy Semantic Layer (available on v1.5 or lower), we **highly** recommend [upgrading your dbt version](/docs/dbt-versions/upgrade-core-in-cloud) to dbt v1.6 or higher to access MetricFlow and the new [dbt Semantic Layer](/docs/use-dbt-semantic-layer/dbt-sl?version=1.6).
<DeprecationNotice />

To migrate to the new Semantic Layer, refer to the dedicated [migration guide](/guides/sl-migration) for more info.

:::

<VersionBlock firstVersion="1.6">

Expand All @@ -38,11 +35,7 @@ A metric is an aggregation over a <Term id="table" /> that supports zero or more
- active users
- monthly recurring revenue (mrr)

In v1.0, dbt supports metric definitions as a new node type. Like [exposures](exposures), metrics appear as nodes in the directed acyclic graph (DAG) and can be expressed in YAML files. Defining metrics in dbt projects encodes crucial business logic in tested, version-controlled code. Further, you can expose these metrics definitions to downstream tooling, which drives consistency and precision in metric reporting.

Review the video below to learn more about metrics, why they're important, and how to get started:

<LoomVideo id="b120ca9d042d46abad1d873a676bf20a" />
In v1.0, dbt supports metric definitions as a new node type. Like [exposures](exposures), metrics appear as nodes in the directed acyclic graph (DAG) and can be expressed in YAML files. Defining metrics in dbt projects encodes crucial business logic in tested, version-controlled code. Further, you can expose these metrics definitions to downstream tooling, which drives consistency and precision in metric reporting.

### Benefits of defining metrics

Expand Down
15 changes: 6 additions & 9 deletions website/docs/docs/cloud/about-cloud-develop-defer.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@ pagination_next: "docs/cloud/cloud-cli-installation"
---


[Defer](/reference/node-selection/defer) is a powerful feature that allows developers to only build and run and test models they've edited without having to first run and build all the models that come before them (upstream parents). This is powered by using a production manifest for comparison, and dbt will resolve the `{{ ref() }}` function with upstream production artifacts.
[Defer](/reference/node-selection/defer) is a powerful feature that allows developers to only build and run and test models they've edited without having to first run and build all the models that come before them (upstream parents). dbt powers this by using a production manifest for comparison, and resolves the `{{ ref() }}` function with upstream production artifacts.

By default, dbt follows these rules:

- Defers to the production environment when there's no development schema.
- If a development schema exists, dbt will prioritize those changes, which minimizes development time and avoids unnecessary model builds.
Both the dbt Cloud IDE and the dbt Cloud CLI enable users to natively defer to production metadata directly in their development workflows.

Both the dbt Cloud IDE and the dbt Cloud CLI allow users to natively defer to production metadata directly in their development workflows.
By default, dbt follows these rules:

For specific scenarios:
- Use [`--favor-state`](/reference/node-selection/defer#favor-state) to always use production artifacts to resolve the ref.
- If facing issues with outdated tables in the development schema, `--favor-state` is an alternative to defer.
- dbt uses the production locations of parent models to resolve `{{ ref() }}` functions, based on metadata from the production environment.
- If a development version of a deferred model exists, dbt preferentially uses the development database location when resolving the reference.
- Passing the [`--favor-state`](/reference/node-selection/defer#favor-state) flag overrides the default behavior and _always_ resolve refs using production metadata, regardless of the presence of a development relation.

For a clean slate, it's a good practice to drop the development schema at the start and end of your development cycle.

Expand Down
14 changes: 7 additions & 7 deletions website/docs/docs/dbt-cloud-apis/sl-graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ mutation {
createQuery(
environmentId: BigInt!
metrics: [{name: "order_total"}]
groupBy: [{name: "metric_time", grain: "month"}]
groupBy: [{name: "metric_time", grain: MONTH}]
) {
queryId
}
Expand All @@ -298,7 +298,7 @@ mutation {
createQuery(
environmentId: BigInt!
metrics: [{name: "food_order_amount"}, {name: "order_gross_profit"}]
groupBy: [{name: "metric_time, grain: "month"}, {name: "customer__customer_type"}]
groupBy: [{name: "metric_time, grain: MONTH}, {name: "customer__customer_type"}]
) {
queryId
}
Expand All @@ -320,7 +320,7 @@ mutation {
createQuery(
environmentId: BigInt!
metrics:[{name: "order_total"}]
groupBy:[{name: "customer__customer_type"}, {name: "metric_time", grain: "month"}]
groupBy:[{name: "customer__customer_type"}, {name: "metric_time", grain: MONTH}]
where:[{sql: "{{ Dimension('customer__customer_type') }} = 'new'"}, {sql:"{{ Dimension('metric_time').grain('month') }} > '2022-10-01'"}]
) {
queryId
Expand All @@ -335,8 +335,8 @@ mutation {
createQuery(
environmentId: BigInt!
metrics: [{name: "order_total"}]
groupBy: [{name: "metric_time", grain: "month"}]
orderBy: [{metric: {name: "order_total"}}, {groupBy: {name: "metric_time", grain: "month"}, descending:true}]
groupBy: [{name: "metric_time", grain: MONTH}]
orderBy: [{metric: {name: "order_total"}}, {groupBy: {name: "metric_time", grain: MONTH}, descending:true}]
) {
queryId
}
Expand All @@ -351,7 +351,7 @@ mutation {
createQuery(
environmentId: BigInt!
metrics: [{name:"food_order_amount"}, {name: "order_gross_profit"}]
groupBy: [{name:"metric_time, grain: "month"}, {name: "customer__customer_type"}]
groupBy: [{name:"metric_time, grain: MONTH}, {name: "customer__customer_type"}]
limit: 10
) {
queryId
Expand All @@ -368,7 +368,7 @@ mutation {
compileSql(
environmentId: BigInt!
metrics: [{name:"food_order_amount"} {name:"order_gross_profit"}]
groupBy: [{name:"metric_time, grain:"month"}, {name:"customer__customer_type"}]
groupBy: [{name:"metric_time, grain: MONTH}, {name:"customer__customer_type"}]
) {
sql
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ import AvailIntegrations from '/snippets/_sl-partner-links.md';

<VersionBlock lastVersion="1.5">

import LegacyInfo from '/snippets/_legacy-sl-callout.md';
import DeprecationNotice from '/snippets/_sl-deprecation-notice.md';

<LegacyInfo />
<DeprecationNotice />

A wide variety of data applications across the modern data stack natively integrate with the dbt Semantic Layer and dbt metrics &mdash; from Business Intelligence tools to notebooks, data catalogs, and more.

Expand Down
4 changes: 2 additions & 2 deletions website/docs/docs/use-dbt-semantic-layer/dbt-sl.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ plan="dbt Cloud Team or Enterprise"

<VersionBlock lastVersion="1.5">

import LegacyInfo from '/snippets/_legacy-sl-callout.md';
import DeprecationNotice from '/snippets/_sl-deprecation-notice.md';

<LegacyInfo />
<DeprecationNotice />

The dbt Semantic Layer allows your data teams to centrally define essential business metrics like `revenue``customer`, and `churn` in the modeling layer (your dbt project) for consistent self-service within downstream data tools like BI and metadata management solutions. The dbt Semantic Layer provides the flexibility to define metrics on top of your existing models and then query those metrics and models in your analysis tools of choice.

Expand Down
8 changes: 4 additions & 4 deletions website/docs/docs/use-dbt-semantic-layer/gsheets.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ The dbt Semantic Layer offers a seamless integration with Google Sheets through

## Prerequisites

1. You have a Google account with access to Google Sheets.
2. You can install Google add-ons.
3. You have [set up the dbt Semantic Layer](/docs/use-dbt-semantic-layer/setup-sl).
4. You have a dbt Cloud Environment ID and a [service token](/docs/dbt-cloud-apis/service-tokens) to authenticate with from a dbt Cloud account.
- You have [configured the dbt Semantic Layer](/docs/use-dbt-semantic-layer/setup-sl) and are using dbt v1.6 or higher.
- You have a Google account with access to Google Sheets.
- You can install Google add-ons.
- You have a dbt Cloud Environment ID and a [service token](/docs/dbt-cloud-apis/service-tokens) to authenticate with from a dbt Cloud account.

## Installing the add-on

Expand Down
4 changes: 2 additions & 2 deletions website/docs/docs/use-dbt-semantic-layer/quickstart-sl.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ User data passes through the Semantic Layer on its way back from the warehouse.

<VersionBlock lastVersion="1.5">

import LegacyInfo from '/snippets/_legacy-sl-callout.md';
import DeprecationNotice from '/snippets/_sl-deprecation-notice.md';

<LegacyInfo />
<DeprecationNotice />

To try out the features of the dbt Semantic Layer, you first need to have a dbt project set up. This quickstart guide will lay out the following steps, and recommends a workflow that demonstrates some of its essential features:

Expand Down
4 changes: 2 additions & 2 deletions website/docs/docs/use-dbt-semantic-layer/setup-sl.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ import SlSetUp from '/snippets/_new-sl-setup.md';

<VersionBlock lastVersion="1.5">

import LegacyInfo from '/snippets/_legacy-sl-callout.md';
import DeprecationNotice from '/snippets/_sl-deprecation-notice.md';

<LegacyInfo />
<DeprecationNotice />

With the dbt Semantic Layer, you can define business metrics, reduce code duplication and inconsistency, create self-service in downstream tools, and more. Configure the dbt Semantic Layer in dbt Cloud to connect with your integrated partner tool.

Expand Down
4 changes: 4 additions & 0 deletions website/docs/docs/use-dbt-semantic-layer/sl-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ The dbt Semantic Layer is proprietary; however, some components of the dbt Seman

<VersionBlock lastVersion="1.5">

import DeprecationNotice from '/snippets/_sl-deprecation-notice.md';

<DeprecationNotice />

## Product architecture

The dbt Semantic Layer product architecture includes four primary components:
Expand Down
9 changes: 5 additions & 4 deletions website/docs/docs/use-dbt-semantic-layer/tableau.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ This integration provides a live connection to the dbt Semantic Layer through Ta

## Prerequisites

1. You must have [Tableau Desktop](https://www.tableau.com/en-gb/products/desktop) installed with version 2021.1 or greater
- You have [configured the dbt Semantic Layer](/docs/use-dbt-semantic-layer/setup-sl) and are using dbt v1.6 or higher.
- You must have [Tableau Desktop](https://www.tableau.com/en-gb/products/desktop) installed with version 2021.1 or greater
- Note that Tableau Online does not currently support custom connectors natively.
2. Log in to Tableau Desktop using either your license or the login details you use for Tableau Server or Tableau Online.
3. You need your dbt Cloud host, [Environment ID](/docs/use-dbt-semantic-layer/setup-sl#set-up-dbt-semantic-layer) and [service token](/docs/dbt-cloud-apis/service-tokens) to log in. This account should be set up with the dbt Semantic Layer.
4. You must have a dbt Cloud Team or Enterprise [account](https://www.getdbt.com/pricing) and multi-tenant [deployment](/docs/cloud/about-cloud/regions-ip-addresses). (Single-Tenant coming soon)
- Log in to Tableau Desktop using either your license or the login details you use for Tableau Server or Tableau Online.
- You need your dbt Cloud host, [Environment ID](/docs/use-dbt-semantic-layer/setup-sl#set-up-dbt-semantic-layer) and [service token](/docs/dbt-cloud-apis/service-tokens) to log in. This account should be set up with the dbt Semantic Layer.
- You must have a dbt Cloud Team or Enterprise [account](https://www.getdbt.com/pricing) and multi-tenant [deployment](/docs/cloud/about-cloud/regions-ip-addresses). (Single-Tenant coming soon)


## Installing
Expand Down
48 changes: 24 additions & 24 deletions website/docs/reference/resource-configs/enabled.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ default_value: true
}>
<TabItem value="models">

<File name='dbt_project.yml'>

```yml
models:
[<resource-path>](/reference/resource-configs/resource-path):
+enabled: true | false

```

</File>

<File name='models/<modelname>.sql'>

```sql
Expand All @@ -35,10 +46,15 @@ select ...

</File>

</TabItem>


<TabItem value="seeds">

<File name='dbt_project.yml'>

```yml
models:
seeds:
[<resource-path>](/reference/resource-configs/resource-path):
+enabled: true | false

Expand All @@ -48,24 +64,19 @@ models:

</TabItem>


<TabItem value="seeds">
<TabItem value="snapshots">

<File name='dbt_project.yml'>

```yml
seeds:
snapshots:
[<resource-path>](/reference/resource-configs/resource-path):
+enabled: true | false

```

</File>

</TabItem>

<TabItem value="snapshots">

<File name='snapshots/<filename>.sql'>

```sql
Expand All @@ -83,21 +94,21 @@ select ...

</File>

</TabItem>

<TabItem value="tests">

<File name='dbt_project.yml'>

```yml
snapshots:
tests:
[<resource-path>](/reference/resource-configs/resource-path):
+enabled: true | false

```

</File>

</TabItem>

<TabItem value="tests">

<File name='tests/<filename>.sql'>

```sql
Expand Down Expand Up @@ -125,17 +136,6 @@ select ...

</File>

<File name='dbt_project.yml'>

```yml
tests:
[<resource-path>](/reference/resource-configs/resource-path):
+enabled: true | false

```

</File>

</TabItem>

<TabItem value="sources">
Expand Down
Loading

0 comments on commit 72c5d3d

Please sign in to comment.