-
Notifications
You must be signed in to change notification settings - Fork 14
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
Default granularity bug fix: handle time dimensions with the same name #305
Conversation
@@ -34,7 +38,7 @@ def transform_model(semantic_manifest: PydanticSemanticManifest) -> PydanticSema | |||
continue | |||
|
|||
default_granularity = TimeGranularity.DAY | |||
seen_agg_time_dimensions: Set[TimeDimensionReference] = set() | |||
seen_agg_time_dimensions: Set[Tuple[SemanticModel, TimeDimensionReference]] = set() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im always wary of using larger objects in sets, so if we could change this to like a semanticmodelreference would be nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call
@@ -49,11 +53,16 @@ def transform_model(semantic_manifest: PydanticSemanticManifest) -> PydanticSema | |||
except AssertionError: | |||
# This indicates the agg_time_dimension is misconfigured, which will fail elsewhere. | |||
# Do nothing here to avoid disrupting the validation process. | |||
logger.warning( | |||
f"Agg time dimension '{agg_time_dimension_ref.element_name}' not found in model." | |||
"This should raise a validation error elsewhere." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is it supposed to raise a validation error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dbt-semantic-interfaces/dbt_semantic_interfaces/validations/agg_time_dimension.py
Lines 47 to 48 in 49a0347
ValidationError( | |
context=measure_context, |
@@ -1,6 +1,6 @@ | |||
[project] | |||
name = "dbt-semantic-interfaces" | |||
version = "0.6.3" | |||
version = "0.6.4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this to a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoot, sorry got Will's approval and merged before I got this 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have seen some people request separate PRs for these bumps, but I just find that it slows down development. What's your thought process on why we should separate them?
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
changie new
to create a changelog entry