-
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
Update support for custom granularity in other types #365
Conversation
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
1 similar comment
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
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.
One concern about case sensitivity but otherwise looks good!!
dbt_semantic_interfaces/transformations/remove_plural_from_window_granularity.py
Outdated
Show resolved
Hide resolved
a88441c
to
256eb9d
Compare
…string instead of TimeGranularity
256eb9d
to
3d873b0
Compare
## Context We merged 2 breaking changes in DSI dbt-labs/dbt-semantic-interfaces#363 and dbt-labs/dbt-semantic-interfaces#365 which changed most spec typing that used time granularity to be a `str` instead of `TimeGranularity` to enable support for custom granularity. Similarly, there were additional breaking changes to the objects that requires passing in `custom_granularity_names`. This PR updates all those callsites to be compatible with the new version of DSI (to be released) Resolves SL-3097
Description
Support custom grain by switching the typing to be not on
TimeGranularity
Metric.time_granularity
-TimeGranularity -> str
Metric.type_params.cumulative_type_params.grain_to_date
-TimeGranularity -> str
MetricInput.offset_to_grain
-TimeGranularity -> str
MetricTimeWindow.granularity
-TimeGranularity -> str
affects the followingMetric.type_params.conversion_type_params.window
Metric.type_params.cumulative_type_params.window
MetricInput.offset_window
Changes to
MetricTimeWindow
Because
MetricTimeWindow.granularity
is now a string, we allow it to be not as strict when ensuring it's a valid granularity during initial yaml parsing (since we don't have access to the custom granularities). Then during validations, we will properly validate that it's a valid grain, and during the transformation step we will remove trailing 's'.Checklist
changie new
to create a changelog entryResolves SL-2826