Skip to content

Commit

Permalink
Merge branch 'ly-docs-trigger-on-merge' of github.com:dbt-labs/docs.g…
Browse files Browse the repository at this point in the history
…etdbt.com into ly-docs-trigger-on-merge
  • Loading branch information
nghi-ly committed Apr 16, 2024
2 parents f486ba6 + fd9a106 commit 80c7fdc
Show file tree
Hide file tree
Showing 24 changed files with 628 additions and 90 deletions.
18 changes: 14 additions & 4 deletions website/docs/docs/build/data-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ You can find more information about these data tests, and additional configurati
Those four tests are enough to get you started. You'll quickly find you want to use a wider variety of tests—a good thing! You can also install generic data tests from a package, or write your own, to use (and reuse) across your dbt project. Check out the [guide on custom generic tests](/best-practices/writing-custom-generic-tests) for more information.

:::info
There are generic tests defined in some open source packages, such as [dbt-utils](https://hub.getdbt.com/dbt-labs/dbt_utils/latest/) and [dbt-expectations](https://hub.getdbt.com/calogica/dbt_expectations/latest/) skip ahead to the docs on [packages](/docs/build/packages) to learn more!
There are generic tests defined in some open-source packages, such as [dbt-utils](https://hub.getdbt.com/dbt-labs/dbt_utils/latest/) and [dbt-expectations](https://hub.getdbt.com/calogica/dbt_expectations/latest/) — skip ahead to the docs on [packages](/docs/build/packages) to learn more!
:::

### Example
Expand Down Expand Up @@ -261,13 +261,23 @@ 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 files as an alias but will be deprecated in the future in favor of `data_tests:`.
<VersionBlock lastVersion="1.7">

In dbt version 1.8, we updated the `tests` configuration to `data_tests`. For detailed information, select version v1.8 from the documentation navigation menu.

</VersionBlock>

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

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 files 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.
As we progress towards this deprecation, we'll update the examples in our docs pages 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.

<File name='models/schema.yml'>

Expand Down
3 changes: 1 addition & 2 deletions website/docs/docs/build/unit-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ You should unit test a model:
- Window functions
- `case when` statements when there are many `when`s
- Truncation
- Recursion
- When you're writing custom logic to process input data, similar to creating a function.
- We don't recommend conducting unit testing for functions like `min()` since these functions are tested extensively by the warehouse. If an unexpected issue arises, it's more likely a result of issues in the underlying data rather than the function itself. Therefore, fixture data in the unit test won't provide valuable information.
- Logic for which you had bugs reported before.
Expand Down Expand Up @@ -287,4 +286,4 @@ There is currently no way to unit test whether the dbt framework inserted/merged
- [Unit testing versioned models](/reference/resource-properties/unit-testing-versions)
- [Unit test inputs](/reference/resource-properties/unit-test-input)
- [Unit test overrides](/reference/resource-properties/unit-test-overrides)
- [Platform-specific data types](/reference/resource-properties/data-types)
- [Platform-specific data types](/reference/resource-properties/data-types)
8 changes: 4 additions & 4 deletions website/docs/docs/cloud/dbt-cloud-ide/ide-user-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ The IDE streamlines your workflow, and features a popular user interface layout

<Lightbox src="/img/docs/dbt-cloud/cloud-ide/ide-command-bar.jpg" width="90%" title="Use the Command bar to write dbt commands, toggle 'Defer', and view the current IDE status"/>

4. **Command bar &mdash;** The Command bar, located in the lower left of the IDE, is used to invoke [dbt commands](/reference/dbt-commands). When a command is invoked, the associated logs are shown in the Invocation History Drawer.
5. **Command bar &mdash;** The Command bar, located in the lower left of the IDE, is used to invoke [dbt commands](/reference/dbt-commands). When a command is invoked, the associated logs are shown in the Invocation History Drawer.

5. **Defer to production &mdash;** The **Defer to production** toggle 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). Refer to [Using defer in dbt Cloud](/docs/cloud/about-cloud-develop-defer#defer-in-the-dbt-cloud-ide) for more info.
6. **Defer to production &mdash;** The **Defer to production** toggle 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). Refer to [Using defer in dbt Cloud](/docs/cloud/about-cloud-develop-defer#defer-in-the-dbt-cloud-ide) for more info.

6. **Status button &mdash;** The IDE Status button, located on the lower right of the IDE, displays the current IDE status. If there is an error in the status or in the dbt code that stops the project from parsing, the button will turn red and display "Error". If there aren't any errors, the button will display a green "Ready" status. To access the [IDE Status modal](#modals-and-menus), simply click on this button.
7. **Status button &mdash;** The IDE Status button, located on the lower right of the IDE, displays the current IDE status. If there is an error in the status or in the dbt code that stops the project from parsing, the button will turn red and display "Error". If there aren't any errors, the button will display a green "Ready" status. To access the [IDE Status modal](#modals-and-menus), simply click on this button.

## Editing features

Expand Down Expand Up @@ -104,7 +104,7 @@ Starting from dbt v1.6 or higher, when you save changes to a model, you can comp

3. **Build button &mdash;** The build button allows users to quickly access dbt commands related to the active model in the File Editor. The available commands include dbt build, dbt test, and dbt run, with options to include only the current resource, the resource and its upstream dependencies, the resource, and its downstream dependencies, or the resource with all dependencies. This menu is available for all executable nodes.

3. **Format button &mdash;** The editor has a **Format** button that can reformat the contents of your files. For SQL files, it uses either `sqlfmt` or `sqlfluff`, and for Python files, it uses `black`.
4. **Format button &mdash;** The editor has a **Format** button that can reformat the contents of your files. For SQL files, it uses either `sqlfmt` or `sqlfluff`, and for Python files, it uses `black`.

5. **Results tab &mdash;** The Results console tab displays the most recent Preview results in tabular format.
<Lightbox src="/img/docs/dbt-cloud/cloud-ide/results-console-tab.jpg" width="90%" title="Preview results show up in the Results console tab"/>
Expand Down
44 changes: 44 additions & 0 deletions website/docs/docs/cloud/secure/snowflake-privatelink.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,47 @@ Once dbt Cloud support completes the configuration, you can start creating new c
3. Select the private endpoint from the dropdown (this will automatically populate the hostname/account field).
4. Configure the remaining data platform details.
5. Test your connection and save it.

## Configuring Network Policies
If your organization uses [Snowflake Network Policies](https://docs.snowflake.com/en/user-guide/network-policies) to restrict access to your Snowflake account, you will need to add a network rule for dbt Cloud.

You can request the VPCE ID from [dbt Cloud Support](mailto:[email protected]), that you can use to create a network policy.

### Using the UI

Open the Snowflake UI and take the following steps:
1. Go to the **Security** tab.
2. Click on **Network Rules**.
3. Click on **Add Rule**.
4. Give the rule a name.
5. Select a database and schema where the rule will be stored. These selections are for permission settings and organizational purposes; they do not affect the rule itself.
6. Set the type to `AWS VPCE ID` and the mode to `Ingress`.
7. Type the VPCE ID provided by dbt Cloud Support into the identifier box and press **Enter**.
8. Click **Create Network Rule**.

<Lightbox src="/img/docs/dbt-cloud/snowflakeprivatelink2.png" title="Create Network Rule"/>

9. In the **Network Policy** tab, edit the policy you want to add the rule to. This could be your account-level policy or a policy specific to the users connecting from dbt Cloud.


10. Add the new rule to the allowed list and click **Update Network Policy**.

<Lightbox src="/img/docs/dbt-cloud/snowflakeprivatelink3.png" title="Update Network Policy"/>

### Using SQL
For quick and automated setup of network rules via SQL in Snowflake, the following commands allow you to create and configure access rules for dbt Cloud. These SQL examples demonstrate how to add a network rule and update your network policy accordingly.

1. Create a new network rule with the following SQL:
```sql
CREATE NETWORK RULE allow_dbt_cloud_access
MODE = INGRESS
TYPE = AWSVPCEID
VALUE_LIST = ('<VPCE_ID>'); -- Replace '<VPCE_ID>' with the actual ID provided
```

2. Add the rule to a network policy with the following SQL:
```sql
ALTER NETWORK POLICY <network_policy_name>
ADD ALLOWED_NETWORK_RULE_LIST =('allow_dbt_cloud_access');
```

3 changes: 0 additions & 3 deletions website/docs/docs/core/about-core-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@ dbt Core is an [open-source](https://github.com/dbt-labs/dbt-core) tool that ena
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: 1 addition & 2 deletions website/docs/docs/core/installation-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@ Most command-line tools, including dbt, have a `--help` flag that you can use to

:::

## Related docs
- [Move from dbt Core to dbt Cloud](/guides/core-to-cloud-1?step=1)

Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Unit tests are defined in YML files in your `models/` directory and are currentl

#### New `data_tests:` syntax

The `tests:` syntax is changing to reflect the addition of unit tests. Start migrating your [data test](/docs/build/data-tests#new-test-syntax) YML to use `data_tests:` after you upgrade to v1.8 to prevent issues in the future.
The `tests:` syntax is changing to reflect the addition of unit tests. Start migrating your [data test](/docs/build/data-tests#new-data_tests-syntax) YML to use `data_tests:` after you upgrade to v1.8 to prevent issues in the future.

```yml

Expand Down
26 changes: 19 additions & 7 deletions website/docs/docs/deploy/job-notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You can receive email alerts about jobs by configuring the dbt Cloud email notif

## Slack notifications

You can receive Slack alerts about jobs by setting up the Slack integration, then configuring the dbt Cloud Slack notification settings.
You can receive Slack alerts about jobs by setting up the Slack integration, then configuring the dbt Cloud Slack notification settings. dbt Cloud integrates with Slack via OAuth to ensure secure authentication.

:::note
If there has been a change in user roles or Slack permissions where you no longer have access to edit a configured Slack channel, please [contact support](mailto:[email protected]) for assistance.
Expand All @@ -52,16 +52,28 @@ If there has been a change in user roles or Slack permissions where you no longe
### Prerequisites
- You must be an administrator of the Slack workspace.
- You must be an account admin to configure Slack notifications in dbt Cloud. For more details, refer to [Users and licenses](/docs/cloud/manage-access/seats-and-users).
- Make sure the notification channel (where you want to receive alerts) is a public channel. The integration only supports public channels in the Slack workspace.
- The integration only supports _public_ channels in the Slack workspace.

### Set up the Slack integration

1. From the gear menu, select **Profile settings**. On your **User profile** page, scroll to the **Linked accounts** section.
1. In the **Linked accounts** section, find the Slack application and click **Link**.
1. From the gear menu, select **Account settings** and then select **Integrations** from the left sidebar.
1. Locate the **OAuth** section with the Slack application and click **Link**.
<Lightbox src="/img/docs/dbt-cloud/Link-your-Slack-Profile.png" width="75%" title="Link for the Slack app"/>
1. Allow dbt Labs to access the Slack workspace. If you are a member of multiple workspaces, you can select the appropriate workspace from the dropdown menu in the upper right corner.

### Logged in to Slack
If you're already logged in to Slack, the handshake only requires allowing the app access. If you're a member of multiple workspaces, you can select the appropriate workspace from the dropdown menu in the upper right corner.
<Lightbox src="/img/docs/dbt-cloud/Allow-dbt-to-access-slack.png" width="75%" title="Allow dbt access to Slack"/>

## Logged out

If you're logged out or the Slack app/website is closed, you must authenticate before completing the integration.

1. Complete the field defining the Slack workspace you want to integrate with dbt Cloud.
<Lightbox src="/img/docs/dbt-cloud/define-workspace.png" width="75%" title="Define the workspace"/>
2. Sign in with an existing identity or use email address and password.
3. Once you have authenticated successfully, accept the permissions.
<Lightbox src="/img/docs/dbt-cloud/accept-permissions.png" width="75%" title="Allow dbt access to Slack"/>

### Configure Slack notifications

1. From the gear menu, choose **Notification settings**.
Expand All @@ -80,5 +92,5 @@ If there has been a change in user roles or Slack permissions where you no longe

### Disable the Slack integration

1. From the gear menu, select **Profile settings**. On your **User profile** page, scroll to the **Linked accounts** section.
1. Find the Slack application in the **Linked accounts** section, click the trash can icon, and click **Unlink**. Channels that you configured will no longer receive Slack notifications. Channels that are configured by other account admins will continue to receive Slack notifications if they still have active Slack integrations. To migrate ownership of a Slack channel notification configuration, have another account admin edit the configuration.
1. From the gear menu, select **Account settings**. On the **Integrations** page, scroll to the **OAuth** section.
1. Click the trash can icon (on the far right of the Slack integration) and click **Unlink**. Channels that you configured will no longer receive Slack notifications. _This is not an account-wide action._ Channels configured by other account admins will continue to receive Slack notifications if they still have active Slack integrations. To migrate ownership of a Slack channel notification configuration, have another account admin edit their configuration.
Loading

0 comments on commit 80c7fdc

Please sign in to comment.