-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Default granularity bug fix: handle time dimensions with the same name (
#305) ### Description Found another bug in SetDefaultGranularityRule. If there are multiple `agg_time_dimensions` with the same name across semantic models, and they have different granularities, we'll only check one. Fixed here! ### Checklist - [x] I have read [the contributing guide](https://github.com/dbt-labs/dbt-semantic-interfaces/blob/main/CONTRIBUTING.md) and understand what's expected of me - [x] I have signed the [CLA](https://docs.getdbt.com/docs/contributor-license-agreements) - [x] This PR includes tests, or tests are not required/relevant for this PR - [ ] I have run `changie new` to [create a changelog entry](https://github.com/dbt-labs/dbt-semantic-interfaces/blob/main/CONTRIBUTING.md#adding-a-changelog-entry)
- Loading branch information
1 parent
7e65636
commit 49a0347
Showing
5 changed files
with
85 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...es/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/bookings_monthly.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
semantic_model: | ||
name: bookings_monthly | ||
description: bookings_monthly | ||
|
||
node_relation: | ||
schema_name: $source_schema | ||
alias: fct_bookings | ||
|
||
defaults: | ||
agg_time_dimension: ds | ||
|
||
measures: | ||
- name: monthly_bookings | ||
expr: "1" | ||
agg: sum | ||
|
||
dimensions: | ||
- name: ds | ||
type: time | ||
type_params: | ||
time_granularity: month | ||
|
||
primary_entity: monthly_booking | ||
|
||
entities: | ||
- name: listing | ||
type: foreign | ||
expr: listing_id | ||
- name: guest | ||
type: foreign | ||
expr: guest_id | ||
- name: host | ||
type: foreign | ||
expr: host_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...res/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/bookings_yearly.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
semantic_model: | ||
name: bookings_yearly | ||
description: bookings_yearly | ||
|
||
node_relation: | ||
schema_name: $source_schema | ||
alias: fct_bookings | ||
|
||
defaults: | ||
agg_time_dimension: ds | ||
|
||
measures: | ||
- name: yearly_bookings | ||
expr: "1" | ||
agg: sum | ||
|
||
dimensions: | ||
- name: ds | ||
type: time | ||
type_params: | ||
time_granularity: year | ||
|
||
primary_entity: yearly_booking | ||
|
||
entities: | ||
- name: listing | ||
type: foreign | ||
expr: listing_id | ||
- name: guest | ||
type: foreign | ||
expr: guest_id | ||
- name: host | ||
type: foreign | ||
expr: host_id |