Skip to content

Commit

Permalink
Merge pull request #105 from dpguthrie/feat/add-fields
Browse files Browse the repository at this point in the history
Add requiresMetricTime field
  • Loading branch information
dpguthrie authored May 27, 2024
2 parents 21dcee9 + 548ab64 commit e4bbe37
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 75 deletions.
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

0 comments on commit e4bbe37

Please sign in to comment.