Skip to content

Commit 0ae2ed5

Browse files
authored
Merge branch 'current' into rpourzand-some-tableau-updates
2 parents 0e9ca04 + e6e6c80 commit 0ae2ed5

File tree

7 files changed

+262
-58
lines changed

7 files changed

+262
-58
lines changed

website/docs/docs/build/groups.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,20 @@ models:
103103
<File name='models/marketing_model.sql'>
104104

105105
```sql
106-
select * from {{ ref('finance_model') }}
106+
select * from {{ ref('finance_private_model') }}
107107
```
108108
</File>
109109

110110
```shell
111111
$ dbt run -s marketing_model
112112
...
113113
dbt.exceptions.DbtReferenceError: Parsing Error
114-
Node model.jaffle_shop.marketing_model attempted to reference node model.jaffle_shop.finance_model,
114+
Node model.jaffle_shop.marketing_model attempted to reference node model.jaffle_shop.finance_private_model,
115115
which is not allowed because the referenced node is private to the finance group.
116116
```
117117

118118
## Related docs
119119

120120
* [Model Access](/docs/collaborate/govern/model-access#groups)
121121
* [Group configuration](/reference/resource-configs/group)
122-
* [Group selection](/reference/node-selection/methods#the-group-method)
122+
* [Group selection](/reference/node-selection/methods#the-group-method)

website/docs/docs/build/metricflow-commands.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Using MetricFlow with dbt Cloud means you won't need to manage versioning &mdash
2525

2626
<TabItem value="cloudcli" label="dbt Cloud CLI">
2727

28-
- MetricFlow commands are embedded in the dbt Cloud CLI. This means you can immediately run them once you install the dbt Cloud CLI and don't need to install MetricFlow separately.
28+
- MetricFlow [commands](#metricflow-commands) are embedded in the dbt Cloud CLI. This means you can immediately run them once you install the dbt Cloud CLI and don't need to install MetricFlow separately.
2929
- You don't need to manage versioning &mdash; your dbt Cloud account will automatically manage the versioning for you.
3030

3131
</TabItem>
@@ -36,21 +36,17 @@ Using MetricFlow with dbt Cloud means you won't need to manage versioning &mdash
3636
You can create metrics using MetricFlow in the dbt Cloud IDE. However, support for running MetricFlow commands in the IDE will be available soon.
3737
:::
3838

39-
40-
4139
</TabItem>
4240

4341
<TabItem value="core" label="dbt Core">
4442

43+
:::tip Use dbt Cloud CLI for semantic layer development
4544

46-
:::info Use dbt Cloud CLI for semantic layer development
47-
48-
Use the dbt Cloud CLI for the experience in defining and querying metrics in your dbt project on dbt Cloud or dbt Core with MetricFlow.
45+
You can use the dbt Cloud CLI for the experience in defining and querying metrics in your dbt project.
4946

5047
A benefit to using the dbt Cloud is that you won't need to manage versioning &mdash; your dbt Cloud account will automatically manage the versioning.
5148
:::
5249

53-
5450
You can install [MetricFlow](https://github.com/dbt-labs/metricflow#getting-started) from [PyPI](https://pypi.org/project/dbt-metricflow/). You need to use `pip` to install MetricFlow on Windows or Linux operating systems:
5551

5652
1. Create or activate your virtual environment `python -m venv venv`
@@ -70,16 +66,16 @@ Something to note, MetricFlow `mf` commands return an error if you have a Metafo
7066
MetricFlow provides the following commands to retrieve metadata and query metrics.
7167

7268
<Tabs>
73-
<TabItem value="cloud" label="Commands for dbt Cloud">
69+
<TabItem value="cloud" label="Commands for dbt Cloud CLI">
7470

75-
Use the `dbt sl` prefix before the command name to execute them in dbt Cloud. For example, to list all metrics, run `dbt sl list metrics`.
71+
You can use the `dbt sl` prefix before the command name to execute them in the dbt Cloud CLI. For example, to list all metrics, run `dbt sl list metrics`.
7672

7773
- [`list`](#list) &mdash; Retrieves metadata values.
7874
- [`list metrics`](#list-metrics) &mdash; Lists metrics with dimensions.
7975
- [`list dimensions`](#list) &mdash; Lists unique dimensions for metrics.
8076
- [`list dimension-values`](#list-dimension-values) &mdash; List dimensions with metrics.
8177
- [`list entities`](#list-entities) &mdash; Lists all unique entities.
82-
- [`query`](#query) &mdash; Query metrics and dimensions you want to see in the command line interface. Refer to [query examples](#query-examples) to help you get started.
78+
- [`query`](#query) &mdash; Query metrics, saved queries, and dimensions you want to see in the command line interface. Refer to [query examples](#query-examples) to help you get started.
8379

8480
<!--below commands aren't supported in dbt cloud yet
8581
- [`validate-configs`](#validate-configs) &mdash; Validates semantic model configurations.
@@ -226,10 +222,11 @@ mf tutorial # In dbt Core
226222

227223
### Query
228224

229-
Create a new query with MetricFlow, execute that query against the user's data platform, and return the result:
225+
Create a new query with MetricFlow and execute it against your data platform. The query returns the following result:
230226

231227
```bash
232228
dbt sl query --metrics <metric_name> --group-by <dimension_name> # In dbt Cloud
229+
dbt sl query --saved-query <name> # In dbt Cloud CLI
233230

234231
mf query --metrics <metric_name> --group-by <dimension_name> # In dbt Core
235232

@@ -372,7 +369,6 @@ mf query --metrics order_total --group-by metric_time,is_food_order --limit 10 -
372369
You can further filter the data set by adding a `where` clause to your query.
373370
374371
**Query**
375-
376372
```bash
377373
# In dbt Cloud
378374
dbt sl query --metrics order_total --group-by metric_time --where "{{ Dimension('order_id__is_food_order') }} = True"
@@ -406,7 +402,6 @@ To filter by time, there are dedicated start and end time options. Using these o
406402
407403
**Query**
408404
```bash
409-
410405
# In dbt Cloud
411406
dbt sl query --metrics order_total --group-by metric_time,is_food_order --limit 10 --order -metric_time --where "is_food_order = True" --start-time '2017-08-22' --end-time '2017-08-27'
412407
@@ -429,9 +424,25 @@ mf query --metrics order_total --group-by metric_time,is_food_order --limit 10 -
429424
430425
</TabItem>
431426
427+
<TabItem value="eg6" label=" Saved queries">
432428
433-
</Tabs>
429+
You can use this for frequently used queries. Replace `<name>` with the name of your [saved query](/docs/build/saved-queries).
430+
431+
**Query**
432+
```bash
433+
dbt sl query --saved-query <name> # In dbt Cloud
434+
435+
mf query --saved-query <name> # In dbt Core
436+
```
437+
438+
For example, if you use dbt Cloud and have a saved query named `new_customer_orders`, you would run `dbt sl query --saved-query new_customer_orders`.
434439
440+
:::info A note on querying saved queries
441+
When querying [saved queries](/docs/build/saved-queries),you can use parameters such as `where`, `limit`, `order`, `compile`, and so on. However, keep in mind that you can't access `metric` or `group_by` parameters in this context. This is because they are predetermined and fixed parameters for saved queries, and you can't change them at query time. If you would like to query more metrics or dimensions, you can build the query using the standard format.
442+
:::
443+
444+
</TabItem>
445+
</Tabs>
435446
436447
### Additional query examples
437448

website/docs/docs/cloud/manage-access/sso-overview.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ pagination_prev: null
88
This overview explains how users are provisioned in dbt Cloud via Single Sign-On (SSO).
99
dbt Cloud supports JIT (Just-in-Time) provisioning and IdP-initiated login. You can learn more about our supported options [here](https://www.getdbt.com/pricing/).
1010

11-
:::tip Configuring SSO
12-
Once you configure SSO, even partially, you cannot disable or revert it. When you configure it, you will want to make sure you do so completely.
13-
:::
14-
1511
## Prerequisites
1612

1713
- You have a dbt Cloud account enrolled in the Enterprise plan. [Contact us](mailto:[email protected]) to learn more and enroll.

website/docs/docs/dbt-cloud-apis/sl-graphql.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,31 @@ Dimension {
217217
DimensionType = [CATEGORICAL, TIME]
218218
```
219219

220+
**List saved queries**
221+
222+
```graphql
223+
{
224+
savedQueries(environmentId: 200532) {
225+
name
226+
description
227+
label
228+
queryParams {
229+
metrics {
230+
name
231+
}
232+
groupBy {
233+
name
234+
grain
235+
datePart
236+
}
237+
where {
238+
whereSqlTemplate
239+
}
240+
}
241+
}
242+
}
243+
```
244+
220245
### Querying
221246

222247
When querying for data, _either_ a `groupBy` _or_ a `metrics` selection is required.
@@ -576,3 +601,38 @@ mutation {
576601
}
577602
}
578603
```
604+
605+
**Querying compile SQL with saved queries**
606+
607+
This query includes the field `savedQuery` and generates the SQL based on a predefined [saved query](/docs/build/saved-queries),rather than dynamically building it from a list of metrics and groupings. You can use this for frequently used queries.
608+
609+
```graphql
610+
mutation {
611+
compileSql(
612+
environmentId: 200532
613+
savedQuery: "new_customer_orders" # new field
614+
) {
615+
queryId
616+
sql
617+
}
618+
}
619+
```
620+
621+
:::info A note on querying saved queries
622+
When querying [saved queries](/docs/build/saved-queries),you can use parameters such as `where`, `limit`, `order`, `compile`, and so on. However, keep in mind that you can't access `metric` or `group_by` parameters in this context. This is because they are predetermined and fixed parameters for saved queries, and you can't change them at query time. If you would like to query more metrics or dimensions, you can build the query using the standard format.
623+
:::
624+
625+
**Create query with saved queries**
626+
627+
This takes the same inputs as the `createQuery` mutation, but includes the field `savedQuery`. You can use this for frequently used queries.
628+
629+
```graphql
630+
mutation {
631+
createQuery(
632+
environmentId: 200532
633+
savedQuery: "new_customer_orders" # new field
634+
) {
635+
queryId
636+
}
637+
}
638+
```

0 commit comments

Comments
 (0)