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 requiresMetricTime field #105

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 75 additions & 74 deletions dbtc/client/semantic_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,101 +68,102 @@ class _SemanticLayerClient(_Client):
query GetMetrics($environmentId: BigInt!) {
metrics(environmentId: $environmentId) {
description
requiresMetricTime
measures {
agg
aggTimeDimension
expr
name
agg
aggTimeDimension
expr
name
}
entities {
description
expr
name
role
type
description
expr
name
role
type
}
filter {
whereSqlTemplate
whereSqlTemplate
}
label
name
queryableGranularities
type
typeParams {
denominator {
alias
filter {
whereSqlTemplate
denominator {
alias
filter {
whereSqlTemplate
}
name
offsetToGrain
offsetWindow {
count
granularity
}
}
name
offsetToGrain
offsetWindow {
count
granularity
}
}
expr
grainToDate
inputMeasures {
alias
filter {
whereSqlTemplate
expr
grainToDate
inputMeasures {
alias
filter {
whereSqlTemplate
}
name
}
name
}
measure {
alias
filter {
whereSqlTemplate
}
name
}
metrics {
alias
filter {
whereSqlTemplate
measure {
alias
filter {
whereSqlTemplate
}
name
}
name
offsetToGrain
offsetWindow {
count
granularity
metrics {
alias
filter {
whereSqlTemplate
}
name
offsetToGrain
offsetWindow {
count
granularity
}
}
}
numerator {
alias
filter {
whereSqlTemplate
numerator {
alias
filter {
whereSqlTemplate
}
name
offsetToGrain
offsetWindow {
count
granularity
}
}
name
offsetToGrain
offsetWindow {
count
granularity
window {
count
granularity
}
}
window {
count
granularity
}
}
dimensions {
description
expr
isPartition
label
name
qualifiedName
queryableGranularities
type
typeParams {
timeGranularity
validityParams {
isEnd
isStart
description
expr
isPartition
label
name
qualifiedName
queryableGranularities
type
typeParams {
timeGranularity
validityParams {
isEnd
isStart
}
}
}
}
}
}
""",
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/semantic_layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ client = dbtCloudClient(environment_id=1, host="emea.dbt.com")
Assuming that `client` is an instance of `dbtCloudClient`
```py
query_result = client.sl.query(
metrics=["]
metrics=["total_revenue", "total_profit"],
group_by=["customer__region"],
)

Expand Down
Loading