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
mirnawong1 authored Nov 17, 2023
2 parents ed03907 + 740edfa commit af67911
Show file tree
Hide file tree
Showing 57 changed files with 1,259 additions and 291 deletions.
5 changes: 3 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Uncomment if you're publishing docs for a prerelease version of dbt (delete if n
- [ ] 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/docs/dbt-versions/core-upgrade)
-->
- [ ] 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.
- [ ] Review the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) so my content adheres to these guidelines.
- [ ] For [docs versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#about-versioning), review how to [version a whole page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version) and [version a block of content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content).
- [ ] Add a checklist item for anything that needs to happen before this PR is merged, such as "needs technical review" or "change base branch."

Adding new pages (delete if not applicable):
Expand All @@ -22,4 +23,4 @@ Adding new pages (delete if not applicable):
Removing or renaming existing pages (delete if not applicable):
- [ ] Remove page from `website/sidebars.js`
- [ ] Add an entry `website/static/_redirects`
- [ ] [Ran link testing](https://github.com/dbt-labs/docs.getdbt.com#running-the-cypress-tests-locally) to update the links that point to the deleted page
- [ ] Run link testing locally with `npm run build` to update the links that point to the deleted page
17 changes: 17 additions & 0 deletions .github/workflows/asana-connection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Show PR Status in Asana
on:
pull_request:
types: [opened, reopened]

jobs:
create-asana-attachment-job:
runs-on: ubuntu-latest
name: Create pull request attachments on Asana tasks
steps:
- name: Create pull request attachments
uses: Asana/create-app-attachment-github-action@latest
id: postAttachment
with:
asana-secret: ${{ secrets.ASANA_SECRET }}
- name: Log output status
run: echo "Status is ${{ steps.postAttachment.outputs.status }}"
2 changes: 1 addition & 1 deletion website/docs/community/spotlight/oliver-cramer.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ I joined the dbt community in 2022. My current focus is on building modern data

## What dbt community leader do you identify with? How are you looking to grow your leadership in the dbt community?

I like working with dbt Labs' Sean McIntyre to promote Data Vault in Europe and Victoria Mola, also from dbt Labs, is always a great help when I have questions about dbt.
I like working with dbt Labs' Sean McIntyre to promote Data Vault in Europe and Victoria Perez Mola, also from dbt Labs, is always a great help when I have questions about dbt.

## What have you learned from community members? What do you hope others can learn from you?

Expand Down
24 changes: 0 additions & 24 deletions website/docs/dbt-cli/cli-overview.md

This file was deleted.

53 changes: 0 additions & 53 deletions website/docs/docs/about/overview.md

This file was deleted.

18 changes: 6 additions & 12 deletions website/docs/docs/build/measures.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,13 @@ sidebar_label: "Measures"
tags: [Metrics, Semantic Layer]
---

Measures are aggregations performed on columns in your model. They can be used as final metrics or serve as building blocks for more complex metrics. Measures have several inputs, which are described in the following table along with their field types.

| Parameter | Description | Type |
| --------- | ----------- | ---- |
| [`name`](#name) | Provide a name for the measure, which must be unique and can't be repeated across all semantic models in your dbt project. | Required |
| [`description`](#description) | Describes the calculated measure. | Optional |
| [`agg`](#aggregation) | dbt supports aggregations such as `sum`, `min`, `max`, and more. Refer to [Aggregation](/docs/build/measures#aggregation) for the full list of supported aggregation types. | Required |
| [`expr`](#expr) | You can either reference an existing column in the table or use a SQL expression to create or derive a new one. | Optional |
| [`non_additive_dimension`](#non-additive-dimensions) | Non-additive dimensions can be specified for measures that cannot be aggregated over certain dimensions, such as bank account balances, to avoid producing incorrect results. | Optional |
| `agg_params` | specific aggregation properties such as a percentile. | Optional |
| `agg_time_dimension` | The time field. Defaults to the default agg time dimension for the semantic model. | Optional |
| `label` | How the metric appears in project docs and downstream integrations. | Required |
Measures are aggregations performed on columns in your model. They can be used as final metrics or serve as building blocks for more complex metrics.

Measures have several inputs, which are described in the following table along with their field types.

import MeasuresParameters from '/snippets/_sl-measures-parameters.md';

<MeasuresParameters />

## Measure spec

Expand Down
4 changes: 2 additions & 2 deletions website/docs/docs/build/saved-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ To define a saved query, refer to the following specification:
The following is an example of a saved query:

```yaml
saved_query:
saved_queries:
name: p0_booking
description: Booking-related metrics that are of the highest priority.
query_params:
metrics:
- bookings
- instant_bookings
group_bys:
group_by:
- TimeDimension('metric_time', 'day')
- Dimension('listing__capacity_latest')
where:
Expand Down
44 changes: 23 additions & 21 deletions website/docs/docs/build/semantic-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ The complete spec for semantic models is below:

```yaml
semantic_models:
- name: the_name_of_the_semantic_model ## Required
description: same as always ## Optional
model: ref('some_model') ## Required
defaults: ## Required
agg_time_dimension: dimension_name ## Required if the model contains dimensions
entities: ## Required
- see more information in entities
measures: ## Optional
- see more information in measures section
dimensions: ## Required
- see more information in dimensions section
- name: the_name_of_the_semantic_model ## Required
description: same as always ## Optional
model: ref('some_model') ## Required
default: ## Required
agg_time_dimension: dimension_name ## Required if the model contains dimensions
entities: ## Required
- see more information in entities
measures: ## Optional
- see more information in measures section
dimensions: ## Required
- see more information in dimensions section
primary_entity: >-
if the semantic model has no primary entity, then this property is required. #Optional if a primary entity exists, otherwise Required
```
Expand Down Expand Up @@ -123,14 +123,18 @@ semantic_models:
config:
enabled: true | false
group: some_group
meta:
some_key: some_value
```

Semantic model config in `dbt_project.yml`:
```yml
semantic_models:
semantic-models:
my_project_name:
+enabled: true | false
+group: some_group
+meta:
some_key: some_value
```

</VersionBlock>
Expand Down Expand Up @@ -226,16 +230,14 @@ For semantic models with a measure, you must have a [primary time group](/docs/b

### Measures

[Measures](/docs/build/measures) are aggregations applied to columns in your data model. They can be used as the foundational building blocks for more complex metrics, or be the final metric itself. Measures have various parameters which are listed in a table along with their descriptions and types.
[Measures](/docs/build/measures) are aggregations applied to columns in your data model. They can be used as the foundational building blocks for more complex metrics, or be the final metric itself.

Measures have various parameters which are listed in a table along with their descriptions and types.

import MeasuresParameters from '/snippets/_sl-measures-parameters.md';

<MeasuresParameters />

| Parameter | Description | Field type |
| --- | --- | --- |
| `name`| Provide a name for the measure, which must be unique and can't be repeated across all semantic models in your dbt project. | Required |
| `description` | Describes the calculated measure. | Optional |
| `agg` | dbt supports the following aggregations: `sum`, `max`, `min`, `count_distinct`, and `sum_boolean`. | Required |
| `expr` | You can either reference an existing column in the table or use a SQL expression to create or derive a new one. | Optional |
| `non_additive_dimension` | Non-additive dimensions can be specified for measures that cannot be aggregated over certain dimensions, such as bank account balances, to avoid producing incorrect results. | Optional |
| `create_metric` | You can create a metric directly from a measure with `create_metric: True` and specify its display name with create_metric_display_name. Default is false. | Optional |


import SetUpPages from '/snippets/_metrics-dependencies.md';
Expand Down
6 changes: 3 additions & 3 deletions website/docs/docs/cloud/cloud-cli-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,13 @@ We recommend using virtual environments (venv) to namespace `cloud-cli`.
2. Make sure you're in your virtual environment and run the following command to install the dbt Cloud CLI:
```bash
pip3 install dbt
pip install dbt --no-cache-dir
```
3. (Optional) To revert back to dbt Core, first uninstall both the dbt Cloud CLI and dbt Core. Then reinstall dbt Core.
3. (Optional) To revert to dbt Core, first uninstall both the dbt Cloud CLI and dbt Core. Then reinstall dbt Core.
```bash
pip3 uninstall dbt-core dbt
pip uninstall dbt-core dbt
pip install dbt-adapter_name --force-reinstall
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ The following fields are required when creating a Postgres, Redshift, or AlloyDB
| Port | Usually 5432 (Postgres) or 5439 (Redshift) | `5439` |
| Database | The logical database to connect to and run queries against. | `analytics` |

**Note**: When you set up a Redshift or Postgres connection in dbt Cloud, SSL-related parameters aren't available as inputs.
**Note**: When you set up a Redshift or Postgres connection in dbt Cloud, SSL-related parameters aren't available as inputs.

<Lightbox src="/img/docs/dbt-cloud/cloud-configuring-dbt-cloud/postgres-redshift-connection.png" width="70%" title="Configuring a Redshift connection"/>

For dbt Cloud users, please log in using the default Database username and password. Note this is because [`IAM` authentication](https://docs.aws.amazon.com/redshift/latest/mgmt/generating-user-credentials.html) is not compatible with dbt Cloud.

### Connecting via an SSH Tunnel

To connect to a Postgres, Redshift, or AlloyDB instance via an SSH tunnel, select the **Use SSH Tunnel** option when creating your connection. When configuring the tunnel, you must supply the hostname, username, and port for the [bastion server](#about-the-bastion-server-in-aws).
Expand Down
4 changes: 2 additions & 2 deletions website/docs/docs/collaborate/govern/model-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ Select the adapter-specific tab for more information on [constraint](/reference/
| Constraint type | Support | Platform enforcement |
|:-----------------|:-------------|:---------------------|
| not_null | ✅ Supported | ✅ Enforced |
| primary_key | ✅ Supported | ✅ Enforced |
| foreign_key | ✅ Supported | ✅ Enforced |
| primary_key | ✅ Supported | ❌ Not enforced |
| foreign_key | ✅ Supported | ❌ Not enforced |
| unique | ❌ Not supported | ❌ Not enforced |
| check | ❌ Not supported | ❌ Not enforced |

Expand Down
26 changes: 26 additions & 0 deletions website/docs/docs/collaborate/govern/model-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,32 @@ dbt.exceptions.AmbiguousAliasError: Compilation Error
We opted to use `generate_alias_name` for this functionality so that the logic remains accessible to end users, and could be reimplemented with custom logic.
:::

### Run a model with multiple versions

To run a model with multiple versions, you can use the [`--select` flag](/reference/node-selection/syntax). For example:

- Run all versions of `dim_customers`:

```bash
dbt run --select dim_customers # Run all versions of the model
```
- Run only version 2 of `dim_customers`:

You can use either of the following commands (both achieve the same result):

```bash
dbt run --select dim_customers.v2 # Run a specific version of the model
dbt run --select dim_customers_v2 # Alternative syntax for the specific version
```

- Run the latest version of `dim_customers` using the `--select` flag shorthand:

```bash
dbt run -s dim_customers version:latest # Run the latest version of the model
```

These commands provide flexibility in managing and executing different versions of a dbt model.

### Optimizing model versions

How you define each model version is completely up to you. While it's easy to start by copy-pasting from one model's SQL definition into another, you should think about _what actually is changing_ from one version to another.
Expand Down
4 changes: 2 additions & 2 deletions website/docs/docs/core/connect-data-platform/fabric-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ meta:

:::info

Below is a guide for use with "Synapse Data Warehouse" a new product within Microsoft Fabric (preview) ([more info](https://learn.microsoft.com/en-us/fabric/data-warehouse/data-warehousing#synapse-data-warehouse))
Below is a guide for use with [Synapse Data Warehouse](https://learn.microsoft.com/en-us/fabric/data-warehouse/data-warehousing#synapse-data-warehouse), a new product within Microsoft Fabric.

To learn how to set up dbt with Azure Synapse Dedicated Pools, see [Microsoft Azure Synapse DWH setup](/docs/core/connect-data-platform/azuresynapse-setup)
To learn how to set up dbt with Azure Synapse Dedicated Pools, refer to [Microsoft Azure Synapse DWH setup](/docs/core/connect-data-platform/azuresynapse-setup).

:::

Expand Down
Loading

0 comments on commit af67911

Please sign in to comment.