-
Notifications
You must be signed in to change notification settings - Fork 98
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 prep #1321
Default granularity prep #1321
Conversation
@@ -570,6 +570,7 @@ class MetricSpec(InstanceSpec): # noqa: D101 | |||
alias: Optional[str] = None | |||
offset_window: Optional[PydanticMetricTimeWindow] = None | |||
offset_to_grain: Optional[TimeGranularity] = None | |||
default_granularity: Optional[TimeGranularity] = None |
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.
The fields in the spec classes should be values that can't be inferred from the semantic manifest. From get_default_granularity_for_metrics
, it seems like it is?
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.
Updated!
@@ -210,3 +210,18 @@ def get_min_queryable_time_granularity(self, metric_reference: MetricReference) | |||
minimum_queryable_granularity = defined_time_granularity | |||
|
|||
return minimum_queryable_granularity | |||
|
|||
def get_default_granularity_for_metrics( |
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.
To confirm - what's the expected behavior when you have a derived metric that depends on two other metrics that have different default time granularities? Based on SetDefaultGranularityRule
, it seems that the default granularity for parent metrics are not intended to be considered.
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.
That's correct. But now that you bring it up, I'm thinking I should confirm that behavior with product, so I'll post about it in #dev-metricflow and see what people think.
Thinking I can probably change this behavior on top of the stack if we decide to go that route.
A few changes preparing to use the
default_granularity
field to resolvemetric_time
granularity.SetDefaultGranularityRule
in CLI rule setdefault_granularity
toMetricSpec
MetricLookup
method toget_default_granularity_for_metrics