Skip to content

Commit

Permalink
Update infer-dbt documentation to fix broken links and add infer-conf…
Browse files Browse the repository at this point in the history
…igs page (#4636)

## What are you changing in this pull request and why?

Found a few broken link son the dbt-infer adapter page. Also added an
infer-configs.md page in line with the other adapters.

## Checklist
- [X] 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.

Adding new pages (delete if not applicable):
- [X] Add page to `website/sidebars.js`
- [X] Provide a unique filename for the new page
  • Loading branch information
mirnawong1 authored Dec 13, 2023
2 parents 254c514 + 99a3ed2 commit b84bdcf
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 6 deletions.
25 changes: 19 additions & 6 deletions website/docs/docs/core/connect-data-platform/infer-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@ meta:
slack_channel_name: n/a
slack_channel_link:
platform_name: 'Infer'
config_page: '/reference/resource-configs/no-configs'
config_page: '/reference/resource-configs/infer-configs'
min_supported_version: n/a
---

:::info Vendor-supported plugin

Certain core functionality may vary. If you would like to report a bug, request a feature, or contribute, you can check out the linked repository and open an issue.

:::

import SetUpPages from '/snippets/_setup-pages-intro.md';

<SetUpPages meta={frontMatter.meta} />



## Connecting to Infer with **dbt-infer**

Infer allows you to perform advanced ML Analytics within SQL as if native to your data warehouse.
Expand All @@ -30,10 +35,18 @@ you can build advanced analysis for any business use case.
Read more about SQL-inf and Infer in the [Infer documentation](https://docs.getinfer.io/).

The `dbt-infer` package allow you to use SQL-inf easily within your DBT models.
You can read more about the `dbt-infer` package itself and how it connecst to Infer in the [dbt-infer documentation](https://dbt.getinfer.io/).
You can read more about the `dbt-infer` package itself and how it connects to Infer in the [dbt-infer documentation](https://dbt.getinfer.io/).

The dbt-infer adapter is maintained via PyPi and installed with pip.
To install the latest dbt-infer package simply run the following within the same shell as you run dbt.
```python
pip install dbt-infer
```

Versioning of dbt-infer follows the standard dbt versioning scheme - meaning if you are using dbt 1.2 the corresponding dbt-infer will be named 1.2.x where is the latest minor version number.

Before using SQL-inf in your DBT models you need to setup an Infer account and generate an API-key for the connection.
You can read how to do that in the [Getting Started Guide](https://dbt.getinfer.io/docs/getting_started#sign-up-to-infer).
You can read how to do that in the [Getting Started Guide](https://docs.getinfer.io/docs/reference/integrations/dbt).

The profile configuration in `profiles.yml` for `dbt-infer` should look something like this:

Expand Down Expand Up @@ -101,10 +114,10 @@ as native SQL functions.

Infer supports a number of SQL-inf commands, including
`PREDICT`, `EXPLAIN`, `CLUSTER`, `SIMILAR_TO`, `TOPICS`, `SENTIMENT`.
You can read more about SQL-inf and the commands it supports in the [SQL-inf Reference Guide](https://docs.getinfer.io/docs/reference).
You can read more about SQL-inf and the commands it supports in the [SQL-inf Reference Guide](https://docs.getinfer.io/docs/category/commands).

To get you started we will give a brief example here of what such a model might look like.
You can find other more complex examples on the [dbt-infer examples page](https://dbt.getinfer.io/docs/examples).
You can find other more complex examples in the [dbt-infer examples repo](https://github.com/inferlabs/dbt-infer-examples).

In our simple example, we will show how to use a previous model 'user_features' to predict churn
by predicting the column `has_churned`.
Expand Down
39 changes: 39 additions & 0 deletions website/docs/reference/resource-configs/infer-configs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: "Infer configurations"
description: "Read this guide to understand how to configure Infer with dbt."
id: "infer-configs"
---


## Authentication

To connect to Infer from your dbt instance you need to set up a correct profile in your `profiles.yml`.

The format of this should look like this:

<File name='~/.dbt/profiles.yml'>

```yaml
<profile-name>:
target: <target-name>
outputs:
<target-name>:
type: infer
url: "<infer-api-endpoint>"
username: "<infer-api-username>"
apikey: "<infer-apikey>"
data_config:
[configuration for your underlying data warehouse]
```
</File>
### Description of Infer Profile Fields
| Field | Required | Description |
|------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | Yes | Must be set to `infer`. This must be included either in `profiles.yml` or in the `dbt_project.yml` file. |
| `url` | Yes | The host name of the Infer server to connect to. Typically this is `https://app.getinfer.io`. |
| `username` | Yes | Your Infer username - the one you use to login. |
| `apikey` | Yes | Your Infer api key. |
| `data_config` | Yes | The configuration for your underlying data warehouse. The format of this follows the format of the configuration for your data warehouse adapter. |
1 change: 1 addition & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ const sidebarSettings = {
"reference/resource-configs/oracle-configs",
"reference/resource-configs/upsolver-configs",
"reference/resource-configs/starrocks-configs",
"reference/resource-configs/infer-configs",
],
},
{
Expand Down

0 comments on commit b84bdcf

Please sign in to comment.