Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add note about ref support #4696

Merged
merged 10 commits into from
Jan 3, 2024
2 changes: 1 addition & 1 deletion website/docs/docs/dbt-cloud-apis/sl-api-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import DeprecationNotice from '/snippets/_sl-deprecation-notice.md';

</VersionBlock>

The rapid growth of different tools in the modern data stack has helped data professionals address the diverse needs of different teams. The downside of this growth is the fragmentation of business logic across teams, tools, and workloads.
The rapid growth of different tools in the modern data stack has helped data professionals address the diverse needs of different teams. The downside of this growth is the fragmentation of business logic across teams, tools, and workloads.<br />

The [dbt Semantic Layer](/docs/use-dbt-semantic-layer/dbt-sl) allows you to define metrics in code (with [MetricFlow](/docs/build/about-metricflow)) and dynamically generate and query datasets in downstream tools based on their dbt governed assets, such as metrics and models. Integrating with the dbt Semantic Layer will help organizations that use your product make more efficient and trustworthy decisions with their data. It also helps you to avoid duplicative coding, optimize development workflow, ensure data governance, and guarantee consistency for data consumers.

Expand Down
2 changes: 2 additions & 0 deletions website/docs/docs/dbt-cloud-apis/sl-graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ The dbt Semantic Layer GraphQL API allows you to explore and query metrics and d

dbt Partners can use the Semantic Layer GraphQL API to build an integration with the dbt Semantic Layer.

Note, the dbt Semantic Layer API doesn't currently support `ref` to call dbt objects. Instead, use the complete qualified table name. If you're using dbt macros at query time to calculate your metrics, you should move those calculations into the Semantic Layer as code.
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved

## Requirements to use the GraphQL API
- A dbt Cloud project on dbt v1.6 or higher
- Metrics are defined and configured
Expand Down
2 changes: 2 additions & 0 deletions website/docs/docs/dbt-cloud-apis/sl-jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ You *may* be able to use our JDBC API with tools that do not have an official in

Refer to [Get started with the dbt Semantic Layer](/docs/use-dbt-semantic-layer/quickstart-sl) for more info.

Note, the dbt Semantic Layer API doesn't currently support `ref` to call dbt objects. Instead, use the complete qualified table name. If you're using dbt macros at query time to calculate your metrics, you should move those calculations into the Semantic Layer as code.
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved

## Authentication

dbt Cloud authorizes requests to the dbt Semantic Layer API. You need to provide an environment ID, host, and [service account tokens](/docs/dbt-cloud-apis/service-tokens).
Expand Down
19 changes: 12 additions & 7 deletions website/docs/guides/sl-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,26 @@ dbt Labs recommends completing these steps in a local dev environment (such as t
1. Create new Semantic Model configs as YAML files in your dbt project.*
1. Upgrade the metrics configs in your project to the new spec.*
1. Delete your old metrics file or remove the `.yml` file extension so they're ignored at parse time. Remove the `dbt-metrics` package from your project. Remove any macros that reference `dbt-metrics`, like `metrics.calculate()`. Make sure that any packages you’re using don't have references to the old metrics spec.
1. Install the CLI with `python -m pip install "dbt-metricflow[your_adapter_name]"`. For example:
1. Install the [dbt Cloud CLI](/docs/cloud/cloud-cli-installation) to run MetricFlow commands and define your semantic model configurations.
- If you're using dbt Core, you can install the [MetricFlow CLI](/docs/build/metricflow-commands) with `python -m pip install "dbt-metricflow[your_adapter_name]"`. For example:
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved

```bash
python -m pip install "dbt-metricflow[snowflake]"
```
**Note** - The MetricFlow CLI is not available in the IDE at this time. Support is coming soon.
**Note** - MetricFlow commands aren't yet supported in the dbt CLoud IDE at this time.

1. Run `dbt parse`. This parses your project and creates a `semantic_manifest.json` file in your target directory. MetricFlow needs this file to query metrics. If you make changes to your configs, you will need to parse your project again.
1. Run `mf list metrics` to view the metrics in your project.
1. Test querying a metric by running `mf query --metrics <metric_name> --group-by <dimensions_name>`. For example:
2. Run `dbt parse`. This parses your project and creates a `semantic_manifest.json` file in your target directory. MetricFlow needs this file to query metrics. If you make changes to your configs, you will need to parse your project again.
3. Run `mf list metrics` to view the metrics in your project.
4. Test querying a metric by running `mf query --metrics <metric_name> --group-by <dimensions_name>`. For example:
```bash
mf query --metrics revenue --group-by metric_time
```
1. Run `mf validate-configs` to run semantic and warehouse validations. This ensures your configs are valid and the underlying objects exist in your warehouse.
1. Push these changes to a new branch in your repo.
5. Run `mf validate-configs` to run semantic and warehouse validations. This ensures your configs are valid and the underlying objects exist in your warehouse.
6. Push these changes to a new branch in your repo.

:::info `ref` not supported
The dbt Semantic Layer API doesn't support `ref` to call dbt objects. This is currently due to differences in architecture between the legacy Semantic Layer and the re-released Semantic Layer. Instead, use the complete qualified table name. If you're using dbt macros at query time to calculate your metrics, you should move those calculations into the Semantic Layer as code.
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
:::

**To make this process easier, dbt Labs provides a [custom migration tool](https://github.com/dbt-labs/dbt-converter) that automates these steps for you. You can find installation instructions in the [README](https://github.com/dbt-labs/dbt-converter/blob/master/README.md). Derived metrics aren’t supported in the migration tool, and will have to be migrated manually.*

Expand Down
Loading