-
Notifications
You must be signed in to change notification settings - Fork 97
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
Bug fix: custom granularity join column gets pruned #1425
Conversation
4da3888
to
5ef7eb6
Compare
454411e
to
deccccb
Compare
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.
Did a pass, this looks great to me 🥳 would love for another reviewer to just do a pass as well tho
metric_specs=(MetricSpec("listings"),), | ||
time_dimension_specs=( | ||
metric_time_with_custom_grain, | ||
TimeDimensionSpec( |
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.
Do you think we need a test that has martian_day
and metric_time__day
since that is what is used for the time spine join? Or does this case sufficiently test that already
metricflow-semantics/metricflow_semantics/naming/dunder_scheme.py
Outdated
Show resolved
Hide resolved
metricflow-semantics/metricflow_semantics/specs/patterns/minimum_time_grain.py
Outdated
Show resolved
Hide resolved
5ff504b
to
f52621f
Compare
…e column gets pruned
f52621f
to
e0ea989
Compare
Implements some small PR feedback from #1425.
We have an issue with the
SqlColumnPruner
where it might prune a column that's used in the join condition, if it's not used anywhere else. There isn't a simple way to fix that issue in the optimizer itself, since the join condition can contain anySqlExpressionNode
, and this appears to only be relevant for the new custom granularity node. Thus, I've fixed this in the custom granularity node instead of the optimizer by rendering the column's expression in the join condition instead of its alias.