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

Use MetricTimeDefaultGranularityPattern to resolve metric_time granularity #1324

Closed

Conversation

courtneyholcomb
Copy link
Contributor

This is the main behavior change for this feature. Here, we apply the MetricTimeDefaultGranularityPattern for group by and filter resolution so that metric_time defaults to the default granularity instead of the minimum one.

There is one case where we actually want the minimum granularity instead of the default granularity for metric_time, which is when determining the granularity used to adjust time constraints. The only_use_minimum_grain flag is used for that purpose.

Note that very few tests are impacted by this change because default_granularity defaults to DAY or the minimum granularity for a time dimension if it's not set on the metric. This is the same behavior as before since no time dimensions have been added to our tests with sub-daily granularity yet. In an upcoming PR I will have tests that add default_granularity to some metrics to see the changes.

You will see a handful snapshot changes here. These reflect an intentional behavior change (agreed on by product) in which we don't error if metric_time is queried for metrics with two different default granularities. Instead, we use the larger of the two default_granularities, which is guaranteed to work for both metrics.

@courtneyholcomb courtneyholcomb requested a review from plypaul July 11, 2024 16:13
@cla-bot cla-bot bot added the cla:yes label Jul 11, 2024
This change is intended to make it more clear what the difference is between MinimumTimeGrainPattern and MetricTimeDefaultTimeGranularityPattern, since 'base' might easily be confused with 'default'.
@courtneyholcomb courtneyholcomb changed the base branch from court/default-granularity_2 to court/default-granularity1 July 12, 2024 14:46
These reflect a behavior change in which we don't error if metric_time is queried for metrics with two different default granularities. Instead, we choose the larger of the two, which is guaranteed to work for both metrics.
@courtneyholcomb courtneyholcomb force-pushed the court/default-granularity3 branch from f9793a9 to 5091b26 Compare July 12, 2024 14:48
@courtneyholcomb courtneyholcomb force-pushed the court/default-granularity1 branch 2 times, most recently from 30d5b6c to 86f6109 Compare July 12, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant