fix: min time grain derivation
INSERT DESCRIPTION HERE
Checklist:
- [ ] Covered by tests
- [ ] Ran it and it works as intended
- [ ] Reviewed the diff before requesting a review
- [ ] Checked for unhandled edge cases
- [ ] Linked the issues it closes
- [ ] Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
- [ ] Intend to cherry-pick into the release branch
- [ ] I'm proud of this work!
I had the logic flipped, so it was pulling the smallest of the smallest time grains rather than the largest. That shouldn't have caused a direct regression, but may have had similar effects.
To sum:
The original issue was created because there could be a mismatch between two smallest_time_grain values. There should be no regression with that issue because of this PR.
This new PR was created because when all upstream metrics views didn't have a smallest_time_grain set, it was being set to TIME_GRAIN_YEAR
There's another issue that should not be addressed in this PR where when you are looking at a range that is shorter than your smallest_time_grain, we don't show any options in the dropdown. This is true on Explore as well. The solutions to that should not be part of this PR.
Can/should this PR be merged @briangregoryholmes?