Skip to content
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

Closed
wants to merge 4 commits into from
Closed

Conversation

courtneyholcomb
Copy link
Contributor

A few changes preparing to use the default_granularity field to resolve metric_time granularity.

@@ -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
Copy link
Contributor

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?

Copy link
Contributor Author

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(
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants